Hello!
I have a Sharepoint list called 'tblProduct' which contains a column 'Order' which defines an arbitrary order for the list. I also created collection called 'products_filtered' to use with the Drag and Drop PCF by Scott Durow.
ClearCollect(products_filtered,
AddColumns(
Sort(Filter(tblProduct,Area1=6,Obsolete=false),Order),
"Zone","assigned"
)
);
I have setup the Drag and drop control successfully but I want to save that specific order when you drag and drop items to my Sharepoint list. I am able to save the position of that dragged item. Unfortunately this only changes the order of that item and not all the other items.
Patch(tblProduct,
LookUp(tblProduct,ID=Value(CtlDragDrop.DroppedId)),
{Order:CtlDragDrop.DroppedPosition}
)
I have tried some solutions found on the internet such as generating a row number but for some reason, the order stays the same when I drag items.
// Generate row number code
ClearCollect(
colSolution,
ForAll(
Sequence(CountRows(colMyCollection)),
Patch(
Last(FirstN(colMyCollection, Value)),
{RowNumber: Value}
)
)
)
I'm new to PowerApps. If you could please guide me into what should I do I would be very grateful.
Thank you.