cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sasrsc
Resolver II
Resolver II

Power Apps sending a filtered collection to Power Automate

I have a Power App that shows a Gallery and the individuals can select one or more rows and then click a button and that button triggers a Power Automate flow....

 

This will work and it send the collection (called CollectionComplianceApproval) and the specific variable called ID as a json file.

'FlightOps-SendToCompliance'.Run(JSON(CollectionComplianceApproval.ID))

 

I also try this...

'FlightOps-SendToCompliance'.Run(JSON(ShowColumns(CollectionComplianceApproval,"ID","isChoosen")))

 

and they both work.

 

Ok, so baby steps that works.

 

But what I really want to do ... is send the entire collection under certain conditions...isChoosen is a boolean value and I only want to send the items where that is true. I'm doing a count of rows for this and it produces the correct number of rows in a label with CountRows(Filter(CollectionComplianceApproval,isChoosen)) & " Selected"

 

So in the onSelect I try to use this....

Filter(CollectionComplianceApproval,isChoosen)

 

Again baby steps...

I changed the onSelect to be...

'FlightOps-SendToCompliance'.Run(JSON(Filter(CollectionComplianceApproval,isChoosen,ID)))

in my first attempt and it barks at me ... 

 

This does work ...
'FlightOps-SendToCompliance'.Run(JSON(CollectionComplianceApproval,JSONFormat.IncludeBinaryData))

But that doesn't filter the collection first...

 

Well I tried this and it works...

'FlightOps-SendToCompliance'.Run(JSON(Filter(CollectionComplianceApproval,isChoosen),JSONFormat.IncludeBinaryData))

 

So now it dawns on me that I need to really just send certain columns as that embeds a bunch of junk...

So I try this... and it works...

'FlightOps-SendToCompliance'.Run(JSON(ShowColumns(Filter(CollectionComplianceApproval,isChoosen),"ID"),JSONFormat.IncludeBinaryData))

 

So then it dawns on me that it wasn't liking certain variable types in the json so now that I'm only sending (in this case) one variable called ID I can therefore simplify this some more...

'FlightOps-SendToCompliance'.Run(JSON(ShowColumns(Filter(CollectionComplianceApproval,isChoosen),"ID")))

Automate reads it as ....which is correct for the 4 rows I've sent it...

{"Compose2_Inputs":"[{\"ID\":4},{\"ID\":8},{\"ID\":18},{\"ID\":22}]"}

I am sharing this so that if anyone else tries to search for this they will have a solution... I'm not sure if anyone wants to provide a better "best practice". The docs are here...
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-json

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @sasrsc :

Thank you for sharing this soluion in such detail. 

The point is to format the table that needs to be sent to flow into a string with the JSON() function, and then use Parse Json Action in Flow to parse the string,right?

Hope your solution will be seen by more people.

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @sasrsc :

Thank you for sharing this soluion in such detail. 

The point is to format the table that needs to be sent to flow into a string with the JSON() function, and then use Parse Json Action in Flow to parse the string,right?

Hope your solution will be seen by more people.

Best Regards,

Bof

View solution in original post

v-bofeng-msft
Community Support
Community Support

Hi @sasrsc :

Please consider marking any reply(You can also add a reply yourself) as "Solution" .

If so,everyone will knows that this is a "Solved" issue and more people can see your post.

Best Regards,

Bof

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,989)