cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (7,268)