cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Split multiple collections from PowerApps in Flow and store in variables

Hi,

 

I have 5 different collection in powerapps and passing collection data in form of JSON to MS flow using 

PowerAppsbutton.Run(
Concatenate(
JSON(CollUserAndRoles),
"|",
JSON(CollSuperUserGroup),
"|",
JSON(CollIncident),
"|",
JSON(CollProductsAndTopics),
"|",
JSON(CollRequestor)
)
);

I want to split JSON when pipe (|) occurs and then store 5 different variables, one for each collection. later i will have to pass these 5 variables to 5 custom APIs.

 

I am using split(@{triggerBody()['Compose_Inputs']}, '|'), but it doesn't work. also not sure how to separate them and store in 5 different variables

 

So far what i have done is as below.

 

Annotation 2019-11-02 222053.gif

and i am getting this JSON for all 5 collections

split([{"Id":"a548fc74","OneviewId":"12312321","ShowSaveButtons":false,"UserEmail":"3213213@sat.com","UserFullName":"12321321","UserRole":"Editor"},{"Id":"","OneviewId":"","ShowSaveButtons":true,"UserEmail":"","UserFullName":"","UserRole":""}]|[{"ExistingGroup":"Yes","GroupEmail":"Demo@sat.com","GroupName":"Demo","Id":"a548fc74","ShowSaveButtons":false},{"ExistingGroup":"","GroupEmail":"","GroupName":"","Id":"","ShowSaveButtons":true}]|[{"Id":"a548fc74","IncidentCategory":"Demot","IncidentGroup":"Cherwell IT","ResolverGroup":"demot","ShowSaveButtons":false,"SubCategory":"Demot"},{"Id":"","IncidentCategory":"","IncidentGroup":"","ResolverGroup":"","ShowSaveButtons":true,"SubCategory":""}]|[{"ContentSource":"Umbraco","Id":"a548fc74","ProductName":"test","ShowSaveButtons":false,"SiteUrl":"","Topics":"Test"},{"ContentSource":"","Id":"","ProductName":"","ShowSaveButtons":true,"SiteUrl":"","Topics":""}]|[{"FullName":"Varama","Id":"a548fc74","MasterOneViewId":"12321312","ReqEMail":"varama@sat.com"}], '|')

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @Anonymous,

 

Cause the collections of response from PowerApps are arrays not string, Split could only process the string format, you need to store these collections into an String variable, then use split as below:

Annotation 2019-11-04 110317.png

After split them, store them into an array named Collections. So far, these elements are string array with "/" character, they were created when converting into String, so we need to remove these "\". 

Annotation 2019-11-04 110339.png

 

After that, you can get these collection, you can initialize another array variable to store them.

Please have a try, it will help you.

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

1 REPLY 1
v-litu-msft
Community Support
Community Support

Hi @Anonymous,

 

Cause the collections of response from PowerApps are arrays not string, Split could only process the string format, you need to store these collections into an String variable, then use split as below:

Annotation 2019-11-04 110317.png

After split them, store them into an array named Collections. So far, these elements are string array with "/" character, they were created when converting into String, so we need to remove these "\". 

Annotation 2019-11-04 110339.png

 

After that, you can get these collection, you can initialize another array variable to store them.

Please have a try, it will help you.

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.

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,306)