Hi Brooke @eyedeer,
This wasn’t in the original requirement
Speaking seriously - item creation should not break this, as long as you assign ID automatically based on ID → Maximum → + 1 (or Count +1).
But deleting items will definitely break the solution: it’s not the random picker, but rather the list which will not display the item with nonexistent ID.
And here unfortunately no easy solution comes to my mind.
- You could try to recalculate ID for all the collection, but this will require some external service.
- You could try to mark items as “deleted”, and after the random picker chooses the value, check if the item is “deleted” and re-choose the value. This could be done with similar logic which I showed (additional condition on screen enter). But if users delete items frequently, the “ID re-selection loop” will happen too often.
- Another option - use external service, like Integromat or Zapier, to make the random choices
- May be storing the records in Airtable could help - so that upon deletion you could implement some Airtable functionality to auto-update the IDs. But I’m not sure if this is possible or not.
Best regards, Victor.