Solved
Forum Discussion
bojanvelevski
4 years agoValued Contributor
While you’re waiting for @j.angelevski 's explanation, here’s another one:
$.mapValues((value,key)=> key == 'ABC' ? value.split(',').sort().join() : value)
The expression starts with mapValues fucntion, which allows you to, as the name suggests, map the values of the incoming fields. Following we have a ternary operator. If the key equals ‘ABC’, than split the value on ‘,’ (you’ll get array of strings that are separated with ‘,’ in the original string), sort the array, and than re-join to original string format, again separated with ‘,’. If the Key is not equal to ‘ABC’ than, just pass the original value.