Just can't get this just rigjt.
I have an app that allows the uer to add items to a collection. When added, the app creates a title like "Item 1, Item 2, Item 3, ..." using a global variable to use as in "Item " & varSeqNo. But a user can also delete items from the collection, so a possible result could be "Item 1, Item 3, Item 4, Item 5" for example. When an item is deleted, I want to regenerate the titles so there are no gaps.
I started with a ForAll(colItems,.. but can't patch the items in that collection of course. So Itried a trick to create a new collection as in ClearCollect(colSwap, colItems) then do a ForAllcolSwap) patching colItems. But then no variable in that ForAll.
I tried this: ClearCollect(colSeq, {SeqNo:1}) and then iniside the ForAll(colSwp, include a
Patch(colSeq, First(colSeq), {SeqNo: SeqNo+1}
Probably out of desperation.
Another approach was to use ForAll(Sequence(1,1, cutrows(colItems), and to Patch(colItems, ThisRecord, {Title:"Item " & ThisRecord}).
I have no vested interest in any of the above approaches, just want a solution to renumber the titles, Thanks in advance for any help