cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

Remove Item from Browse Gallery

Hi,

I have a gallery with a checkbox based on a sharepoint list. All I want to do is remove the selected items from the sharepoint list - which then in turn will update my gallery list.

 

I can use this:

Remove(CustomerDeviceList,DeviceGallery.Selected)

 

This only removes 1 item - I cannot find the syntax for RemoveIf which seems it should run through the records and compare to a value in the list - problem is I want to just compare to the checkbox if it is true or not which is not in the list

 

I looked at ForAll but I get an error stating I cannot use the same data source i the forall as the remove option which makes me think I need to create a temporary collection and add items in to it on check and then delete them all

 

I am hoping I do not need to do this - this is supposed to be a powerusers app - not a programmers app and many workarounds I am finding for many things seem to make me think this is not being built with power users in mind.

 

If anyone can tell me how this can be achieved it would be appreciated.

5 REPLIES 5
Highlighted
Solution Sage
Solution Sage

Re: Remove Item from Browse Gallery

Hello Gargoolgala,

If CustomerDeviceList was a collection, this formula works. I hope its the same for the sharepoint list.

Be careful, ColumnName should have unique items for that record. A GUID for example, that is not the same on a different record.

Clear(TempCol);
ForAll(DeviceGallery.AllItems,
Collect(TempCol,{UniqueField:ColumnName});
If(Checkbox1.Value,
Remove(CustomerDeviceList,LookUp(CustomerDeviceList,Last(TempCol).UniqueField=ColumnName))))

Highlighted
Resolver II
Resolver II

Re: Remove Item from Browse Gallery

I have  not had a chance to test this yet as I had to fisrtly get a unique ID to the field to be deleted - this was achieved today and I now need to test this further.

 

Although I still think as a Power Users tools this is overkill to achieve what should be a simply request using RemoveIf

Highlighted
Solution Sage
Solution Sage

Re: Remove Item from Browse Gallery

Hello Gargoolgala,

I agree with you.
There may be an easier way of doing what you need. If you find it, I will use it, too. Please let me know.

Highlighted
Resolver II
Resolver II

Re: Remove Item from Browse Gallery

Mike8,

 

this worked for me - no need for a collection - much simpler.

 

RemoveIf(CustomerDeviceList,LookUp(DeviceGallery.AllItems, ID=CustomerDeviceList[@ID]).Device.Value)

 

I need to get my head around the @Fields but it works a treat 🙂

 

I found it here

https://powerusers.microsoft.com/t5/General-Discussion/Editing-multiple-records-in-Gallery-control/t...

 

It is not the solution on the page but the best approach, it was posted by Steelman a bit down the 1st page.

Highlighted
Solution Sage
Solution Sage

Re: Remove Item from Browse Gallery

Hello Gargoolgala,

Perfect. Your formula is indeed much simpler.
I also need to understand, how we should use @Fields.
I understand the idea but I have problems using it. The documentation could be better if it had examples.

Thank you Gargoolgala 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,827)