Create unique row id when adding new row

I want to have a unique row ID created when every new row is created, so i can find and refer to same row with other people.

The row ID may never change after it has been created and should be +1 more than the highest row ID already existing. And an old deleted ID may never be used again.

I managed to fix this with some hacking in excel but i can't figure it out here.

I managed to automate when a new row was created, another row was created with the ID of +1. So i got a new row, and then another one, where the ID became 1 every time.
But how do read the highest row ID, increase by one, and ad it to the created row?

2 Likes

Auto Increment attribute for the column. Also waiting for similar UNIQUE attribute help.

1 Like

I'm not the OP, but have a similar requirement. Where do you set the Auto Increment attribute, please?

1 Like

One option: we can use row number as id by formatting column as Number , decimal : 0 and column formula ROW().

1 Like

Hi @Jens-591c welcome to the forum and thanks for the question! One simple way I can think of solving this problem is to use an automation. I would create an automation and have it be triggered when a new row is added to the table:

I'd then add an overwrite step, and take =MAX(YourTableName[ID])+1 (assuming your table has a column called ID) and write it to =[ID] to update the column:

This should work as long as you don't delete the row with the highest ID (i.e., a deleted ID may never be used).

If I wanted to strictly enforce that a deleted ID may never be used, I would consider creating a separate table to store the max ID and use it to overwrite IDs on newly created rows similar to above.

4 Likes

Thanks for the suggestion, @Hnin-fccd and welcome to the forum! That's a neat idea! The only challenge I see with that is IDs will not be constant. For instance, if you delete the row that's one before the last one, and the last one happened to have an ID of 10, it would now have an ID of 9. Similarly, if you move rows around, their IDs would change to reflect their new location.

2 Likes

Thanks for explaining details. I didn't think about that part. Thank you so much for pointing this out.

1 Like

Hi,

I would like some cells in my table to be auto-filled with data when I complete the information that the app requires. So here's what I 'm looking to do within my app:

  1. generate a sequential batch number .e.g. 00001, 00002, 00003 etc.
  2. generate a creation date & time

A slightly different request, If I would like the batch number to be shared with a different application, does anyone know if this is possible at all?

Do you think that doing any of these things is possible, and how would I be best to go about doing it, please?

Many thanks in advance!

1 Like

Welcome to our community, @Jame-9dd6! We had a similar question asked as well. Could you please see if @RajeshGoli's Automation solution addressed your inquiry?

2 Likes

Hi @Taylor thanks for the welcome! I can confirm that @RajeshGoli response above did the trick for me thank you both!

2 Likes

Great to hear, @Jame-9dd6! :smiley:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

Hi,

I would like some cells in my table to be auto-filled with data when I complete the information that the app requires. So here's what I 'm looking to do within my app:

  1. generate a sequential batch number .e.g. 00001, 00002, 00003 etc.
  2. generate a creation date & time

A slightly different request, If I would like the batch number to be shared with a different application, does anyone know if this is possible at all?

Do you think that doing any of these things is possible, and how would I be best to go about doing it, please?

Many thanks in advance!

Hi Jame, welcome to the community!

See the merged thread for your first question about creating a sequential number in your tables. For your second question about generating a creation date & time, this can be done using automations and the =NOW() functions. See Triggers & Actions for more details.

1 Like