I have a column with following contents in Open Refine
1. {"result":"Mango"}
2. {"result":"Banana"},{"result":"Apple"}
and I need resulting column
1. Mango
2. Banana | Apple
The expression I tried was
"forEach(value.parseJson().result).join(' | ')"
but this does not produce results.
Your second example isn't valid JSON, so I'm not sure what the parse will produce -- probably just the first object. One approach would be to wrap each cell with square brackets (
[]) to turn it into a JSON array. This will give you something thatforEachcan operate on.