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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,280)