There aren't enough code snippets when I google for things, so I figure I should document this so that whoever comes after me can do it too.
I did this in a dynamic page, hence use of .getCurrentItem()
#dataset = dataset for the page..
aTagField = whatever tag field in the dataset
tempVariable = storing it as a string (no spaces yet) so I can use the .replace on it
finalResult = modified string with spaces
let tempVariable = "" + $w('#dataset').getCurrentItem().aTagField let finalResult = tempVariable.replace(/,/g, ", ");
Hope this helps someone.
@kn the tags field is an array so you can simplify it to one line using join let commaSep = $w('#dynamicDataset).getCurrentItem().tags.join(", ")
possible to do the other way around? like if i wish to convert a string like ["a","b"] to separate tags in the collection? so it'll show "a" and "b" as a separate field tag