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
Solved! Go to Solution.
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
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
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
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
214 | |
205 | |
86 | |
59 | |
38 |
User | Count |
---|---|
322 | |
260 | |
127 | |
86 | |
55 |