cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rob_danks
Regular Visitor

Select multiple records in a Power app and pass to a Flow

I am designing a Power app for a user to select multiple Purchase order numbers from D365FO and then trigger a Flow and pass the selected PO numbers to the Flow.

 

I have used a browse gallery in a canvas app and added a checkbox against the PO numbers, but I cannot find how to pass all the selected PO numbers to the Flow, I can do this for a single PO number but not multiple.

 

Any help appreciated.

 

Thanks in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @rob_danks ,

 

According to your description, the point is the JSON() function.

 

I've made a test for your reference:

1\ Add a button control and set is onselect property to:

ClearCollect(Test,{PO:"1"},{PO:"2"},{PO:"3"})

v-xiaochen-msft_0-1613721974358.png

 

2\ Build an instant flow

v-xiaochen-msft_1-1613722210741.png

v-xiaochen-msft_2-1613722230132.png

Content:Ask in Powerapps

Generate from sample:[{"PO":"test"}]

v-xiaochen-msft_3-1613722309062.png

 

3\ Add the flow to a button control and set its onselect property to:

Test26.Run(JSON(Test))

//Test26 is the name of my flow

 

4\ The result is as follows:

v-xiaochen-msft_4-1613722479065.png

v-xiaochen-msft_5-1613722505218.png

 

v-xiaochen-msft_6-1613722518201.png

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

 

 

 

 

View solution in original post

@rob_danks @robdanks 

Add below to OnCheck property of checkbox control:

 

Collect(targetCollection, {PO: ThisItem.PO});

 

Replace of PO in ThisItem.PO with the actual name of your PO column.

Then add below formula on OnUnCheck property of checkbox control:

 

Remove(targetCollection, LookUp(targetCollection, PO = ThisItem.PO))

 

For more information check: Remove items from collection with checkbox 


Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

7 REPLIES 7
v-xiaochen-msft
Community Support
Community Support

Hi @rob_danks ,

 

According to your description, the point is the JSON() function.

 

I've made a test for your reference:

1\ Add a button control and set is onselect property to:

ClearCollect(Test,{PO:"1"},{PO:"2"},{PO:"3"})

v-xiaochen-msft_0-1613721974358.png

 

2\ Build an instant flow

v-xiaochen-msft_1-1613722210741.png

v-xiaochen-msft_2-1613722230132.png

Content:Ask in Powerapps

Generate from sample:[{"PO":"test"}]

v-xiaochen-msft_3-1613722309062.png

 

3\ Add the flow to a button control and set its onselect property to:

Test26.Run(JSON(Test))

//Test26 is the name of my flow

 

4\ The result is as follows:

v-xiaochen-msft_4-1613722479065.png

v-xiaochen-msft_5-1613722505218.png

 

v-xiaochen-msft_6-1613722518201.png

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

 

 

 

 

View solution in original post

Thanks @v-xiaochen-msft 

how do I replace {PO:"1"},{PO:"2"},{PO:"3"} with the selected PO’s in my Browse gallery?

@rob_danks @robdanks 

Add below to OnCheck property of checkbox control:

 

Collect(targetCollection, {PO: ThisItem.PO});

 

Replace of PO in ThisItem.PO with the actual name of your PO column.

Then add below formula on OnUnCheck property of checkbox control:

 

Remove(targetCollection, LookUp(targetCollection, PO = ThisItem.PO))

 

For more information check: Remove items from collection with checkbox 


Please click Accept as solution & 👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

v-xiaochen-msft
Community Support
Community Support

Hi @robdanks / @rob_danks ,

 

Could you tell me:
Has the problem been solved?
Is there anything else I can help?

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Yes that worked thanks, but I an struggling to login with the account that I created the post with to mark it as a solution!

@robdanks Which solution worked for you? you can tell us here and the moderators will accept it as a solution on behalf of you.


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

rob_danks
Regular Visitor

It was a combination of the two solutions, so I have accepted as solution on both, many thanks both.

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,343)