My app is beginning to take shape and it already has a lot of data that I’ll go live with. I am beginning to add drag-drop ordering of items in many data types. In order for this to work, I am adding Position fields to define the order for displaying things in repeating groups. And, of course, values in Position fields will be changed by the drag-drop process.
Here’s my problem:
The Position fields are all empty at this point since there was no need for values before I had drag-drop ordering. How can I rip through lists and update Position with sequential values?
I know something about Make changes to a list. As I study it, I don’t see any way to update anything outside each current thing nor do I see any way to update a field based on a previous thing as the Make changes to a list process does its work one thing at a time.
One way I envision this is if I set a custom state value to 1, then with each thing processed by the Make changes to a list step, update the Position field with the custom state value and increment the custom state value.
Another way I envision this is to first have a step to set the Position value of the first thing in the list to 1. Then in the Make changes to a list step, set the Position value to the previous thing’s Position + 1.
I don’t see any facility in Make changes to a list for doing either of these.
What is a workable solution for this?