Auto increment to sort list

Hi,

I have a table that contains a list of questions, where users can only see those questions available to them.

The first column in my table is a numerical position, which I envisage incrementing from 1 onwards.

I am having a couple of issues with this:
1 - If I use the autoincrement field, this doesn’t start from one for each user’s list.
2 - If a question record is deleted, how can I fix the numbering, for example in a list of 1, 2, 3, 4, if 3 is deleted, 4 should update to be the new 3.

Any suggestions would be greatly appreciated.

Thanks!

Hi @emileg,

I had a very similar requirement and the way I achieved it was to utilise the Tadabase Rest Pipe to retrieve the number of records (filtered by user in your case) already in the table and then increment that by 1 when adding. You can also removed the default delete link from the table and create you own so that you gain control of the delete process. I didn’t need to do the second part in my case but you could then establish which records you needed to update (above and below) and update accordingly I suppose. Like you, I was hoping that there might have been something out of the box but I couldn’t find anything simpler :unamused:

1 Like

Hi @GREDDIE,

Thank you very much for your reply. You have confirmed what my understanding of the out of the box capability was and your solution will actually solve my problem. Thank you! :slight_smile:

1 Like