I have viewed numerous solutions to convert a multiple choice question in a form to separate variables in a list.

I used this one: https://www.intelogy.co.uk/blog/how-to-populate-a-multi-select-column-in-sharepoint-from-forms/ and the flow checker said it was OK, but when I run a test I get this error:

ExpressionEvaluationFailed The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Format_Form_output')' is of type 'String'. The result must be a valid array.

I can't see where it is going wrong.

The expressions in the two previous steps are:

replace(replace(replace(body('Get_response_details')?['r2e950a0ca31e424a925b931c2328ce14'],'","','|'), '["',''), '"]','')



1 Answer 1


The ‘Format_Form_output’ step is a string, but the ‘Apply_to_each’ action expects an array.

If the output is a string that represents an array, you can convert it to an actual array using the array function.

If the output could be null, you can use the Coalesce function to ensure it defaults to an empty array instead of null.

If the trigger of your flow has a "split on" setting, make sure it’s set to true.

See: https://powerusers.microsoft.com/t5/Building-Flows/ExpressionEvaluationFailed-The-execution-of-template-action/td-p/808850

And: https://powerusers.microsoft.com/t5/Building-Flows/The-execution-of-template-action-Apply-to-each-failed-the-result/td-p/671019

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.