Iterate through an log record

I am trying to determine a status of a scenario as passed/failed
| fieldsAdd status = event[steps]
Each step record can have a list of element and results:
example:
[ { “result”: “passed”, “error”: “” },{ “name”: “I login to profile”, “result”: “passed”, “error”: “” }, ] 
i need to iterate through it, if any of the result is failed, the scenario will get a failed status 
else passed

Thank you

Hey @olgatimbur

If all you need is whether or not there is a fail could you use the contains function as below?

fetch logs
| fieldsAdd status = if(contains(content, "\"result\": \"failed\""), "failed", else:"passed")

Thank you