I have collection like below. I have row number added while adding new item to that collection.
If I have 5 items in my collections, If I delete 3rd Item, I wanted to reorder the RowNumber again. Since Order will be changed like (1,2,4,5) when deleting in-between any rows.
Kindly let me know how to update the collection while deleting any row.
Solved! Go to Solution.
Hi,
I think this will not work..
Ex : 1,2,3,4,5 If I delete RowNumber 1 then update collectiong using UpdateIf my row will be like that ...1,3,4,5 but I want 1,2,3,4
Hi @Anonymous
I tested the code @Pstork1 provided and works fine for RowNumber 1 as well. Same code but Used Datasource instead of a collection.
Below code when removing the item from the gallery.
Set(currentrow,BrowseGallery1.Selected.RowNumber);
Remove('Desk Reservation',LookUp('Desk Reservation',RowNumber=BrowseGallery1.Selected.RowNumber));
UpdateIf('Desk Reservation',RowNumber > currentrow,{RowNumber: RowNumber -1});
Thanks,
Stalin - Learn To Illuminate
No, if you delete RowNumber 1 then it will update everything with a rowNumber greater than 1. Which would be 2,3,4,5. They would become 1,2,3,4. It will also work if you delete RowNumber 5 because the Update won't do anything since no RowNumber is greater than 5. UpdateIf() will go through the whole collection and update all the records that meet the criteria.
Yes, Your are right. Its working. I compared with Equal but It's suppose to be Greater than and Equal
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
70 | |
50 | |
46 | |
20 |
User | Count |
---|---|
253 | |
120 | |
84 | |
79 | |
68 |