for a workflow I need to get the approvers from an external SharePoint list.
When I add a 'Compose' with an Array format (["firstname.lastname@example.org", "email@example.com"]), 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 (["firstname.lastname@example.org", "email@example.com"]) 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
Whether you’ve streamed the digital event live, or you're watching on-demand, claim your attendee badge to sport on your profile.
Watch Microsoft Business Applications Summit sessions on-demand.
The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!
We are excited to announce the launch of Power Virtual Agents Community. Check it out now!
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
The top training and networking event across the globe for Microsoft Business Applications