This is the error I'm getting with my flow. I've copied a flow from a previously answered post to assist with creating a flow which uses conditional formulas to send emails to different people based on the multiple-choice topic. See below:
"The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body/resourceData']' is of type 'Object'. The result must be a valid array."
I don't know the entire process, but can you check if isn't more suitable to use a switch control there to check the values and execute action based on adequate branch.
For sure, the provided solution will execute actions (conditions) that can be avoided.
There is no need to use Apply_to_each in order to read the Forms response details as the trigger-outputs/body/resourceData is an object. You can give up to Apply to each (there is no reason to use it) and use directly Forms - Get response details action.
But if you insist to use Apply_to_each, actually yes my solution ...
[@triggerOutputs()?['body/resourceData']]
will make your flow runs successfully.
Hope it helps !
Here is another screen shot. Was I correct to include all these conditions under the same "Apple to each" step?
Here is a screenshot of the flow. The part with the "Gte responses" and "Conditional" functions are both under "apply to each". Do you need anything more?
As the error says:
@triggerOutputs()?['body/resourceData']
is an object, not an array to be used in Apply_to_each.
You can force that object to be considered an array using in apply_to_each
[@triggerOutputs()?['body/resourceData']]
but I don't think that will solve the problem.
Can you give more details about your flow ?
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2