How to prevent duplicate tags in Websources Script?

The deduplication for e.g. names in a list can be done in a websource script in the following way.

Before we store the new name in the output buffer “soloist” containing the list of names we have to check if it is already in this output buffer.
The command findinline seems to do right that, but unfortunately it works the other way around: It finds a given string in the current input line. Because we are searching for a string in another output buffer, we first have to exchange the contents of the two buffers.
We store the new name into in a temporary used output buffer “temp_name” and then load the content of the output buffer “soloist” with the command regexpreplace "^.*" "%soloist%" in the current input line.
But two more things have to be taken care of:
To actually test if the command findinline has found a match we mark the end of the line with a vertical bar | and to avoid a substring to trigger a match we have to enclose the strings with our delimiter \\.
Your example now can be extended like that:

set "SOLOIST" 
json_select "artist"
json_foreach "artist"
   json_select "name"
      set "temp_name"
      outputto "temp_name"
      SayRest
      regexpreplace "^.*" "\\\\%soloist%\\\\|"
      findinline "\\%temp_name%\\" 1 1
      movechar -1
      if "|"
         outputto "soloist"
         ifoutput "soloist"
            say "\\\\"
         endif
         sayoutput "temp_name"
      endif
json_foreach_end

It uses the new feature available since version 3.23 to reference contents of output buffers via %output% in all string parameters.
The "feature" to overload the input line with the regexreplace "^.*" "string" is very valuable for writing websource scripts, that do "currently impossible" things.

Hope this helps.

PS The number of backslashs was not correct. Thanks to Output referral and special characters - #2 by rboss