I've got a flow that pulls content from a form and puts into the body of a VSO work item. I get this error and not sure how to interpret it:
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@{triggerOutputs()?['body/resourceData/responseId']}@{triggerBody()?['body']}@{triggerOutputs()?['body/resourceData']}' is of type 'String'. The result must be a valid array. Thanks for any help
What type of data are you trying to loop through here? SharePoint, Excel, OneDrive, something else? Without knowing that or seeing how your data is organized, I can only guess what you would need to select for your loop. But for many of the connectors, the array of values is accessible in dynamic content as "value" or "values". Is there something like that that you could try?
Here is the error when I select "body":
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body']' is of type 'Object'. The result must be a valid array.
Thanks Jronash. I've tried using a single reference (Rosponse Id, resourceData & body) separately but they all come back with an error as they don't appear to be in the array format. I'm wondering if there is an expectation to store the record in a file to then reference? Thanks for any other suggestions
Sounds like there's a problem with the "Select an output from previous steps" field in your "Apply to each" block. I think if you look at your Flow, you'll see that you have two references to dynamic content there. You can only have one. Delete the one you don't need, and it should run.