Solved! Go to Solution.
Was able to fix my own issue using a combination of "Apply to Each" and the item() expression. I was able to output the value as follows:
[{"name":"Value A"},{"name":"Value B"},{"name":"Value C"}]
Step 1: Take the string, use split() to convert the string into an array based on the delimiter.
Step 2: Create an array variable with no value.
Step 3: Using the "Apply to each" control, take the Compose output from Step 1 and input the key pairing I needed, "name" in this case. The item() function returns an array object for each iteration when used with "Apply to each".
Step 3A. Append the output from Compose 2 to the Array Variable.
Here's a screenshot of the flow:
Was able to fix my own issue using a combination of "Apply to Each" and the item() expression. I was able to output the value as follows:
[{"name":"Value A"},{"name":"Value B"},{"name":"Value C"}]
Step 1: Take the string, use split() to convert the string into an array based on the delimiter.
Step 2: Create an array variable with no value.
Step 3: Using the "Apply to each" control, take the Compose output from Step 1 and input the key pairing I needed, "name" in this case. The item() function returns an array object for each iteration when used with "Apply to each".
Step 3A. Append the output from Compose 2 to the Array Variable.
Here's a screenshot of the flow:
Too long...
1, Init array variable
2, do ParseJSON for your JSON in string
3, Set body from ParseJSON outcome directly as an array value in SetVariable you created in step 1.
No need to apply to each and additional clutter. Works for me.
Tomas
Except that method doesn't give me what I'm looking for. Your solution only supplies an array without the necessary JSON key, it just supplies the value.
I was solving the same issue today and I managed to convert the JSON string to JSON array using json() expression.
More details can be found in the link below.
http://persnicketypowerapps.blogspot.com/2018/10/json-operations-in-ms-flow.html
Thank you so much!!!
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
45 | |
45 | |
39 | |
35 | |
23 |
User | Count |
---|---|
48 | |
32 | |
32 | |
31 | |
29 |