Hi All,
I'm creating a gallery in which items can be sorted by the user using two arrow icons to move them up or down:
Pressing the icons updates a column called 'Sorting order', for instance:
OnSelect= Set(varSort,ThisItem.SortOrder);
Patch(collection,LookUp(collection,SortOrder=Text(Value(varSort+1))),{SortOrder:varSort});
Patch(collection,LookUp(collection,ID=ThisItem.ID),{SortOrder:Value(varSort)+1})
In turn, the gallery is sorted, based on the value of the Sort Order column:
Items =
Sort(
Filter(
collection,
IsBlank(LinkedDocument)
),
"SortOrder",
Descending
)
As you can see in the above picture, initially this gives the correct order (the number is ThisItem.'Sort Order'). When clicking on either of the item, the values of the Sort Order change correctly, yet the order of the items in the gallery doesn't (clicked 'Up' on the bottom, red item):
Can anybody give an idea of what should do to get the order of the item in the gallery to what it should be? Thanks!