cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aman_varama
Level: Powered On

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 Team
Community Support Team

Re: Split multiple collections from PowerApps in Flow and store in variables

Hi @aman_varama,

 

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 Team
Community Support Team

Re: Split multiple collections from PowerApps in Flow and store in variables

Hi @aman_varama,

 

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,218)