cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
larschrjensen
Level: Power Up

Removing item from gallery after it is added to collection

I'm creating an app for checking out assets. Currently items are added to a collection before it is checked out. What I can't figure out is how to remove items that are added to the cart (collection) but not checked out yet (that is, patched to the source). I'm using the following filter on the gallery:

Filter(ds; StartsWith(Title; searchField.Text) && InService = 1 && CheckedOut = 0)

I've been thinking of filtering ds on the basis of the cart collection, but can't quite connect the dots. My source (ds) is a sharepoint list.

Any pointers?

4 REPLIES 4
Community Support Team
Community Support Team

Re: Removing item from gallery after it is added to collection

Hi @larschrjensen,

 

Do you want to only show remained items from the SharePoint list to a gallery after others have been added to a collection?

Please take the following scenario for a reference.

Frist, create a connection to SharePoint List 11.

On the gallery screen, add a search box, and set Screen.OnVisible with the following code:

ClearCollect(testlist11collection,AddColumns(Filter(List11,StartsWith(Title,TextSearchBox1.Text)),"NewTitle",Title))

Then add a Gallery and set its Items property with this code which will only show items that are not in the collection:

Filter(List11,Not(Title in testlist11collection.NewTitle))

A screenshot for your reference:

 1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rebeccas
Level 10

Re: Removing item from gallery after it is added to collection

For mine I put a little trash can next to the item and then just have the OnSelect = Remove(CollectionName,ThisItem)

rebeccas
Level 10

Re: Removing item from gallery after it is added to collection

Inside the Gallery...I forgot to say that.

KroonOfficeSol
Level 10

Re: Removing item from gallery after it is added to collection

Filter(ds, !(id in collection.id))

This should be enough for what you want.

Paul