cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Laksh_05
Frequent Visitor

submit gallery items based on checkbox

Hi,

 

I have a gallery displaying filtered contents from a SP list.

 

I have added a checkbox to the gallery for the user to be able to select specific items in the list. Once the user has selected the items, he would press the submit button to send the 'unique_id' variable for the selected items to a flow. 

 

The submit button needs to trigger a flow and send a list of the selected items 'unique_id' as parameter to the flow.  The flow would be using these id's to create records in a new SP list. 

 

can you help me with the code to be able to do this in the app. also, how would i use the submitted id's in flow, i.e. what code to put in the condition dialog box.

 

Regards

Laksh

2 REPLIES 2
eka24
Super User
Super User

You can try Without Flow:

On the OnCheck of the checkbox inside the Gallery, put:

Patch(Datasource,ThisItem,{Unique_ID: Label1.Text})

This will patch into the datasource whenever you check the checkbox

 

Using flow as you suggested, create a variable:

On the OnCheck of the checkbox inside the Gallery, put:

Set(varUnique_ID,ThisItem.Unique_ID)
 
You can then use the variable varUnique_ID in your flow
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Laksh_05
Frequent Visitor

Here is what I did,

on the Oncheck property :

If(IsBlank(LookUp(CheckedItems,  UID =ThisItem.ID)),
    Collect(CheckedItems, {UID : ThisItem.ID })
   )

 

on the Onuncheck Property :

If(!IsBlank(LookUp(CheckedItems,UID = ThisItem.ID)),
    Remove(CheckedItems,LookUp(CheckedItems, UID = ThisItem.ID))
  )

 

What I need now is

1. Ability to transfer this collection of single column to Power Automate  as a parameter

2. How do I fetch all SP list items that match with this collection (ID matches) received from Power App.

3. Create a new item in another list only for the matched items.

 

I cannot use patch as there are different permission levels involved for each of the 2 lists.

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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