for a workflow I need to get the approvers from an external SharePoint list.
When I add a 'Compose' with an Array format (["email@example.com", "firstname.lastname@example.org"]), it is recognized as an Array object, and I use the Componse in a 'For Each' loop.
But when I get exactly the same string (["email@example.com", "firstname.lastname@example.org"]) from a SharePoint item, it does not get recognized as an Array, and the 'For Each' loop breaks with the following error:
ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Compose')' is of type 'String'. The result must be a valid array.
Any idea how I can fix it?
Solved! Go to Solution.
The reason is, Sharepoint List do not support Array type columns, so you will probably have stored it as a 'single line of text', that is treated as a string in Power Automate.
You need to convert it into an array first
-Initialize variable, name myArray, type array, assign as its value the column value output from your 'Get item'
If it does not work, I would suggest to use replace() to remove some characters and combine it with split() using comma as separator
Not in front of my laptop, so I haven't been able to test it
Hope this helps
Check out the announcement of Power Platform content at Microsoft Ignite!
Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.
Features releasing from October 2020 through March 2021