Building on @SteveCole , once you have an array of items, use the function Concatenate to turn the array into a single string. This avoids having an extra line break at the end.
return Concatenate(
Split($feature['hazards'], ','),
'\n'
)
Then again, if your items are broken up by commas, you could just use Replace.
return Replace($feature['hazards'], ',', '\n')
You could also use Replace to swap the underscores for spaces.
var spaced = Replace($feature['hazards'], '_', ' ')
return Replace(spaced, ',', '\n')
- Josh Carlson
Kendall County GIS