I have the JSON below......
How can I get the array below from the JSON above?
[
Thank you this is the ONLY Correct way to perform this. The append to variable method is WAY TOO INNEFICIENT. I wish I could Upvote x1000.
Well if you're only looking at the title of the initial question you're correct, but the provided example of Harbie contained JSON objects within an array within a JSON object.
If you look at zapower's example It looks like you and him are trying to do the same thing, (for which the select action will not work).
But i don't know what exactly your desired result is, and i don't see an easy way to do it dynamically.
If you just hardcode the names of the Objects you could use a compose action with the following content to get an Array out of zapowers example:
createArray(outputs('Compose_JSON_Objects')?['7ee5fb1d-fef6-483e-84e6-9b4d960f2d80'],outputs('Compose_JSON_Objects')?['3022a04a-5248-4bc0-af78-39f0f48ae292'],outputs('Compose_JSON_Objects')?['5bd1d5b7-119a-4e90-862c-756b8e13c3fc'])
So theoretically you could first list all the names of the desired Objects, and then access them with said list.
Edit:
the step "Compose_JSON_Objects" from above is this here:
I'm not sure I understand your solution. The question was how to get an array out of the object given, but your example is how to make an array out of a different array. The select action can't even accept an object in the from property.
How would you convert an object into an array?
Before I create a new post, maybe someone here can help me.
I also try to convert JSON Object to Array, i tired a lot of different approaches but everything seems to fail.
Here my JSON:
Hi mgisbert
Have you tried my way of using the select action?
For me this one seems to work even with null values
I've done this and I realised the Append into array does not allow null values. How could this be done if some of the values coming from the JSON object can be null?
Thanks!
This is a much simpler and clever way I would say.
Also If you need an array for each step inside a loop in parallel mode (the problem that I was solving) you need to use this option instead of looping and appending to an array variable because the array will be filled in parallel and you will get messed up values since it's a global variable and in contrast the Select action outputs a context variable for each loop interaction that works fine.
Hi
My favorite way is to use a select action like this:
From:
outputs('Compose_JSON_Array')?['value']
Map: you have to switch to text mode, delete the brackets etc. and enter the Expression
item()?['Email']
Like in the Picture:
This should result in this:
wow man! Gonna try rn
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.