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.
Super User
Super User

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)

Super User
Super User

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

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 169 members 5,347 guests
Please welcome our newest community members: