I have a table of tasks with a Priority column and I need to make sure the Priority of all tasks are sequential. I’m not planning to do this with validation, but rather when the form is submitted, the server action will update the other records as needed.
So if the user edits or enters a new task, and assigs it a Priority that already exists, when it’s saved, the server action needs to bump the Priority value all other records with a value equal to or greater than the one being saved.
So in my server action, I have the following:
The query checks if there are other records with a Priority greater or equal to the one being saved:
Then, if there are any, the repeat loops over them and increments the values. The problem I’m having is the SetValue is concatenating the value instead of adding it. So 6 becomes 61 instead of 7 like it should.
I’ve used the Data Formats screen to configure the value:
Any idea how to get this to work?