In NiFi I'm processing a flowfile containing the following attribute:
Key: 'my_array'
Value: '[u'firstElement', u'secondElement']'
I'd like to split flowFile on this array to process each element separately (and then merge). I tried to use SplitJson processor, but it requires JSON content to operate on, so I used AttributesToJSON before it. Unfortunately the produced flowFile's content is:
{"my_array": "[u'firstElement', u'secondElement'"}
And I receive the error
The evaluated value [u'firstElement', u'secondElement'] of $['my_array'] was not a JSON Array compatible type and cannot be split.
Is it possible to convert my_array string to the correct JSON array? Do I need to use ExecuteScript or is there some simpler way?

[u'firstElement', u'secondElement']has not a valid json format. i think it's a kind of python formatting. - daggett"[u'firstElement', u'secondElement']"instead of[u'firstElement', u'secondElement']- triveltorg.python.core.PyList cannot be cast to java.lang.String, so it seems that Python script has to return string. - triveltjson.dumps(...)to convert python data to json-formatted string - daggett