Hello,
@aprildunnam shows in this nice video (Youtube link)how to organize items in a gallery (up, down, delete). Seems like a good example, because the individual actions are going well. Unless you first delete an item somewhere in the middle and then try to move the one directly below it up. Then it will fail.
Who has a solution to this problem?
Thanks & greetings from the Netherlands!
Jorne
Solved! Go to Solution.
Hi @JvandeKraats :
I suggest you set the Trash icon's OnSelelct property to:
Set(TheOrder,ThisItem.Order); /*TheOrder is my custom variable*/
Remove(agenda,ThisItem);
UpdateIf(agenda,Order>=TheOrder,{Order:Order-1})
Doing so can ensure that the order of all items are continuous.
Best Regards,
Bof
Hi @JvandeKraats :
I suggest you set the Trash icon's OnSelelct property to:
Set(TheOrder,ThisItem.Order); /*TheOrder is my custom variable*/
Remove(agenda,ThisItem);
UpdateIf(agenda,Order>=TheOrder,{Order:Order-1})
Doing so can ensure that the order of all items are continuous.
Best Regards,
Bof
Dear Bof,
Thank you for the simple, but great solution for my problem.
Have a nice day!
Best regards,
Jorne
Found another solution which doesn't involve having to remove all the items when something is deleted.
Because April's method depends on all the order numbers being in a sequential order it fails when items get deleted. However, on Shane's YouTube channel he has a video which shows how to update a column with new row numbers even when items are removed. See here: PowerApps Tracker App including Add row numbers to a gallery.
So to get this to work with April's method I just added a step to update the row numbers each time a selection is made. Now item's can get ordered and removed at the same time!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
177 | |
52 | |
41 | |
36 | |
27 |
User | Count |
---|---|
240 | |
81 | |
71 | |
69 | |
66 |