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

Add selected item from a gallery to a collection

Hi

I need help with gallery and collections.

 

I have gallery1 that pulls data from a SQL Server table and is filtered by the text entered in the "Pesquisa" (Search) field above.

 

I would like gallery2 to be a subset of what was selected in gallery1, and the data in gallery1 may vary as the user makes the filter.

 

therefore, I thought about saving the items from gallery1 selected by the user in a collection, when he clicks the ">" button for each item in gallery1 he chooses.

 

and those items in the collection would be displayed in gallery2, just as he could delete the item from the collection by clicking the "X" button in gallery2.

 

because I will save the items contained in this collection, or gallery2, in another SQL Server table.

 

How would it be possible to implement this, or something similar, with the same functionality.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Add selected item from a gallery to a collection

@galdezanni
Put this code in the OnSelect property of the Gallery1

Collect(targetCollection, ThisItem);


Then in Gallery2 use this code in the Items property

targetCollection


---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

1 REPLY 1
Super User
Super User

Re: Add selected item from a gallery to a collection

@galdezanni
Put this code in the OnSelect property of the Gallery1

Collect(targetCollection, ThisItem);


Then in Gallery2 use this code in the Items property

targetCollection


---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,153)