cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

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
Highlighted
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
Highlighted
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

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (4,719)