power automate - How do I work with Microsoft Forms' arrays that are formatted as strings in the trigger body? - Stack O

admin2025-04-19  0

I have a MS form where I am asking for multiple attachments. In the forms response body from the trigger, the attachments array is formatted as a string. I want it to be an array so I can loop through it and parse each object and move on. This is much more complex than it should be. How do I get this to be an array in power automate so I can loop through it? I cannot initialize an array variable with this value because it is a string.

Here is what the response data looks like (see the highlighted field's value is a string):

I have tried to cast is as an array with the "array()" function and that does not work. This is what happens when I do that:

I also tried to remove the quotes from the first and last characters of the string to no avail. Any help is very appreciated!

I have a MS form where I am asking for multiple attachments. In the forms response body from the trigger, the attachments array is formatted as a string. I want it to be an array so I can loop through it and parse each object and move on. This is much more complex than it should be. How do I get this to be an array in power automate so I can loop through it? I cannot initialize an array variable with this value because it is a string.

Here is what the response data looks like (see the highlighted field's value is a string):

I have tried to cast is as an array with the "array()" function and that does not work. This is what happens when I do that:

I also tried to remove the quotes from the first and last characters of the string to no avail. Any help is very appreciated!

Share Improve this question asked Mar 4 at 0:03 Jon WalzerJon Walzer 671 gold badge1 silver badge8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Use the json() expression, not array().

I'd give you a better answer but it's not that simple given the question is a little ambiguous with how your flow is structured, i.e. I can't see it all.

Either way, use json(), that will do it for you.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745066809a283036.html

最新回复(0)