cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shrri
Frequent Visitor

Remove(collection, Thisitem) not working in user mode.

Hello, all. I am facing a problem that develop mode works but user mode cannot work. Here is a collection in a gallery. And I set a button with "Remove(Mycollection, thisitem)" .  I test it in develop mode well. But lots of my users feed back to me that they can delete first item but cannot delete the others. IE , Chrome and EDGE cannot work. Did some one know why this bug happened. Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Shrri ,

 

Since you are trying to remove items from collection,  the entire record must match. Reference from Remove function .

However, What 'ThisItem' returns doesn't match the entire record, which also contains some control information within the gallery.

The workaround is to use LookUp function to retrieve the entire record from collection through Unique identifier field.

Remove(Collection, LookUp(Collection, GUIDField=ThisItem.GUIDField))  //GUIDField is the unique index column

Hope this helps.

Sik

View solution in original post

4 REPLIES 4
WarrenBelz
Super User III
Super User III

HI @Shrri ,

Assuming this is a SharePoint list - I use

RemoveIf(
   MyListName,
   ID=ThisItem.ID
)

and have found it does the job.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Shrri
Frequent Visitor

It is not from a SharePoint list,It is a collection by 'collect(mycollection, item1,item2,item3)', no fields like [ID] to identify them.

Hi @Shrri ,

Just did a test on this end

Remove(
    colWhatever,
    ThisItem
)

worked fine. What are the Items of your Gallery? 

v-siky-msft
Community Support
Community Support

Hi @Shrri ,

 

Since you are trying to remove items from collection,  the entire record must match. Reference from Remove function .

However, What 'ThisItem' returns doesn't match the entire record, which also contains some control information within the gallery.

The workaround is to use LookUp function to retrieve the entire record from collection through Unique identifier field.

Remove(Collection, LookUp(Collection, GUIDField=ThisItem.GUIDField))  //GUIDField is the unique index column

Hope this helps.

Sik

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (63,010)