cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gasilva8
Helper II
Helper II

Delete list items based on filtered gallery

I have a gallery on my app showing items from a SP List, and I would like to delete items from that same list based on filtered items shown on gallery.

I set a search box to filter gallery items based on a specific column from the list (Column1).

Now I'm trying to delete all items remained on the gallery after the filter is applied, based on another column of that SP List (Column2).

Here is what I'm doing:

 

Gallery.Items = Filter('SP List', searchQuery in Column1)

Button.OnSelect = Remove('SP List', Filter('SP List', Gallery.AllItems.Column2 = Column2))

 

I realized that is not possible to do "Gallery.AllItems.Column2 = Column2" since I'm comparing a table with a single row.

I tried "Gallery.Selected.Column2 = Column2" and it deletes a single record each time I push the button.

 

Any suggestion on how to do delete all items at the same time?

Thank you!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@gasilva8 

Please consider changing your Formula to the following:

Remove('SP List', Filter(Gallery.AllItems, Column2 = Column2).ID)

 

Remove takes a table of records with primary keys (in this case ID) and will remove all that are in that table.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@gasilva8 

Please consider changing your Formula to the following:

Remove('SP List', Filter(Gallery.AllItems, Column2 = Column2).ID)

 

Remove takes a table of records with primary keys (in this case ID) and will remove all that are in that table.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
gasilva8
Helper II
Helper II

Hey @RandyHayes.

Thank you so much!! That worked perfectly.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,064)