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

Run a flow in a power apps loop

Hi, im newbie in power apps and i'm trying to loop a collection in power apps, filter by a boolean and if it´s true, run a flow. I mean, run a flow 'x' times inside a loop in power apps. It works for me too if any can explain me how to send a collection to flow and loop this in flow. 

Thanks to everyone.

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Dual Super User
Dual Super User

The most "elegant" way to solve your problem is to use JSON function in PowerApps:

 

Set(readyToFlow,JSON(MyCollection,JSONFormat.IgnoreBinaryData))

 

and pass this variable to PowerAutomate:

gabibalaban_0-1600244971241.png

After that inside PowerAutomate, the trickiest part is to define the JSON schema. My option to do it is to let PowerAutomate to generate from sample. For that you need a temporary label in PowerApps with Text value set to readyToFlow  and OverFlow to Scroll.

 

With App in PlayMode, copy the label value (by select all and copy) and paste it inside generate from sample. PowerAutomate will do the rest to generate your JSON schema.

 

And now you are ready to create your actions in PowerAutomate.

 

Hope it helps !

 

View solution in original post

6 REPLIES 6
gabibalaban
Dual Super User
Dual Super User

The most "elegant" way to solve your problem is to use JSON function in PowerApps:

 

Set(readyToFlow,JSON(MyCollection,JSONFormat.IgnoreBinaryData))

 

and pass this variable to PowerAutomate:

gabibalaban_0-1600244971241.png

After that inside PowerAutomate, the trickiest part is to define the JSON schema. My option to do it is to let PowerAutomate to generate from sample. For that you need a temporary label in PowerApps with Text value set to readyToFlow  and OverFlow to Scroll.

 

With App in PlayMode, copy the label value (by select all and copy) and paste it inside generate from sample. PowerAutomate will do the rest to generate your JSON schema.

 

And now you are ready to create your actions in PowerAutomate.

 

Hope it helps !

 

Anonymous
Not applicable

I was trying it but when i tried to convert to JSON always appears an error. I try¡ied to set Set(EmpleadosJSON,JSON(Empleados)) and show after in a label the variable but always appear 'contains parenClose where expected error'.  Do you know why appears this error?

The rest I think is the correct solution. Thanks a lot

 

Hi @Anonymous again 😊,

 

Please try:

Set(EmpleadosJSON,JSON(Empleados,JSONFormat.IgnoreBinaryData)) 

 

I think that you have some sort of binary data inside.

Hope it helps !

 

 

Anonymous
Not applicable

I tried this too but it appears the same problem. I don't know if  it is a dont recognized variable. Underlines like an error the first parenthesis and the first coma if it helps

Can you insert a printscreen with the error ?

Anonymous
Not applicable

I solved it. I comment it in case someone has the same error. It was expecting ';' and not ',' in all. I don't know why.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,404)