cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Error Removing Item from Collection in Mobile App

I have a very simple build but for some reason the mobile app is not running as intended even though I have the exact same structure in a "Tablet" app that works just fine.

 

  • Screen 1 - Add items to collection
  • Screen 2 - View collection w/ delete button on each line item to remove from collection
    • Remove(SelectedOutReservations, ThisItem)

For some reason, the delete button only works on the first item and not anything subsequent. It does this when I run the app on the powerapps ios application or in my computer web browser.

 

Like I mentioned, I have a tablet app with the same exact format and the delete button works just fine.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Still not sure what happened here but I restored a previous version and it works as expected. Looking at the code though, nothing is different. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Still not sure what happened here but I restored a previous version and it works as expected. Looking at the code though, nothing is different. 

Hi @Anonymous :

The fromula looks fine.In order to verify whether my thought is correct, I did a test but did not encounted the problem.

Then I even found an article introducing this method through Google

https://sachinbansal.blog/2018/07/08/powerapp-cds-for-apps-remove-items-from-gallery-list-add-delete-button-in-gallery-control/

In addition, I know that there is a situation that will cause the wrong record to be deleted:

There are completely duplicate records in the data source.

I assume that the first record and the fifth records in SelectedOutReservations are exactly the same. When I try to delete the fifth record, the first record will be deleted. This is related to how the Remove function works.

For collections, the entire record must match. You can use the All argument to remove all copies of a record; otherwise, only one copy of the record is removed.

Best Regards,

Bof

Hi @Anonymous :
Has the problem been solved?
Is there anything else I can help?
Best Regards,
Bof

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,730)