I am trying $filter a subset of json based an email address in the JSON payload which I copied to flow.fileContents context data (attached), trying many variations of the function syntax. I get a $distinct list of emailAddress copied to msg.arrayEntry, and then I use the Rollun Common foreach successfully iterate on that list.
This JSONata is return undefined. I also tried flow.fileContents without the $. msg.arrayEntry and $msg.arrayEntry were previously attempted (legacy message disappeared when I switched to payload.arrayEntry).
Why am I missing? Is flow not accessible inside JSONata?
Thank you that was helpful in checking the flow reference while debugging (yes, the data is still in the flow context), but I still get undefined in the $filter statement:
To note, if theere is only one match the output will be an object not an array with a single object, this maybe OK for you, but if you require an array of object/s then enclose the expression in square brackets to force an array output.