cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Extract JSON string data from variable populated from PowerApps Collection

I have been doing a lot of research and continue to struggle with how to work with data I received from PowerApps.  I had to use JSON to pass a collection with an embedded table to MS Flow.  The data looks like the below screen shot when I receive it in the variable in Flow.  I really just need to get the email address from that string array.  I have tried many iterations of substring, split and other expressions with no luck.  Any idea how I can extract only the email address to be used later in the flow.  There are about 65 items in this list.  The real problem I am having is the "email": being passed with the data due to the embedded table of data in PowerApps.

 

[
{
"email": "email address here"
},
{
"email": "email address here"
},

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Hi @Chad_Mitchell,

 

The instance you provided is an array, so you could input it into an Apply to each action to loop through all items, then use the expression:

item()?['email']

to get each email address:

Annotation 2020-06-18 134056.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

@v-litu-msft 

that did it.  I used parse JSON after the variable and then the apply to each you suggested.  I now have all the email addresses.  Just need to get them back in a string so I can send the email.  Thank you.

View solution in original post

5 REPLIES 5
Community Support
Community Support

Hi @Chad_Mitchell,

 

The instance you provided is an array, so you could input it into an Apply to each action to loop through all items, then use the expression:

item()?['email']

to get each email address:

Annotation 2020-06-18 134056.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

@v-litu-msft 

I tried what you suggested.  My problem is the variable I am getting from PowerApps seems to be a string even though it is in the array.  Here is what I got when trying your suggestion.  I tried it using the Variable first and then a compose into the apply to each.  Wonder if I need to convert it to an array first. 

 

Chad_Mitchell_0-1592575065417.png

 

@v-litu-msft 

that did it.  I used parse JSON after the variable and then the apply to each you suggested.  I now have all the email addresses.  Just need to get them back in a string so I can send the email.  Thank you.

View solution in original post

Hi @Chad_Mitchell,

 

You could initialize a string variable, then loop through all emails and append them + ";" into the string variable, then you could get a string that only contains emails:

Annotation 2020-06-23 172841.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That is perfect @v-litu-msft .  I really appreciate the help and getting me moving in the right direction. 

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (10,125)