Hi David,
The java.lang.ArrayIndexOutOfBoundsException: 1 error means that you are attempting to access an element in an array that doesn't exist
The expression:
value.split(',')[1] + ' ' + value.split(',')[0]
Will work for strings that have a comma in them, but any string without a comma will give the out of bounds error because in that case the 'split' will create an array with only one thing in it - so when you try to access the second element in the array (with [1]) it finds that this is beyond the end of the array (out of bounds)
For example:
Stephens,Owen -> value.split(",") -> ["Stephens","Owen"] - two items in the array
Stephens Owen -> value.split(",") -> ["Stephens Owen"] - one item in the array
So - you will need to make sure that you have your names in the appropriate format to start with (family name comma given name(s) ) for this expression to work. If you can share some data and your desired outcome we may be able to suggest some approaches that might help (although managing names is always tricky because they vary so much across cultures and they can be written in so many different ways!)
Best wishes
Owen