cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chad_Mitchell
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
v-litu-msft
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
v-litu-msft
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.

 

@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.

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,564)