I think you are making TWO mistakes! I had this same problem only about a week ago, and solved it with the following python code:
PYTHON SCRIPT
in_doc[‘KEYS’]= json.loads( ln )
output.write(in_doc)
ln is the array
HEADER CHANGE to the python script:
from com.snaplogic.scripting.language import ScriptHook
import java.util
import json
from pprint import pprint
So I can hook a json spliter snap onto the script snap, and process each line coming from the snap. The intent was to reprocess data from a reltio load error in snaplogic, and it gets the detail from the payload in the error. The payload could have dozens of entities represented in the one payload.
There is probably a similar problem with jscript.
Steve