Rather than try and correct the problem after it has happened you can prevent the problem from happening in the first place by adding the following at the start of the script
If (PatternCount ( List ( tags::tag_label ); products::g_tags & "¶") > 0)
SetField (products::g_tags; "")
If required you can add a Custom Dialogue to state the tag already exists
Since the last item returned by List will have the return, ¶, character following it. You might update that expression to be:
PatternCount ( List ( tags::tag_label ) & ¶ ; products::g_tags & "¶") > 0
Very true, thanks for the correction
I only had to update the expression to read
PatternCount(List( products_tags::uk_products_tags) & ¶ ; products::id_products & "::" & products::g_tags & "¶") > 0
and it does exactly what I want.
And as usual, now I feel silly for not having thought of it.
Hopefully I'm not back with more problems too often.