Auto Number

Can we create auto number while adding data? I use GSheet for Database.

I’m afraid that’s not going to work. If two users or more are using the app at the same time, multi records will have the same number.

This article likely applies:

1 Like

Bambang_Christianto:

auto number while adding data

@Bambang_Christianto - can you clarify if this “auto number” has to be the key, or just a visible sequential number?

If you have another column for the unique key (let’s say you use UNIQUEID() in the Initial Value), then I think you could create another Virtual Column (let’s say call it [number]) with:

  1. Try using an appformula using ROW()-1… or
  2. use an ARRAYFORMULA in your Gsheet so that it automatically creates the number for each row. (eg: =arrayformula(ROW(F2:F10)-1). If you go the gsheet route, you should add an IF condition just before the ROW calculation to prevent the arrayformula from expanding past blank rows… There are other ways to limit the auto expansion as well, but it depends on your data structure.

Depends if the number is the record key…

1 Like

Mike:

Try using an appformula using ROW()-1

Would be ([_ROWNUMBER] - 1). ROW() is a spreadsheet function.

You could also try COUNT(MyTable[_ROWNUMBER]).

1 Like

oops… mixing topics. Thanks for catching!

can you clarify if this “auto number” has to be the key, or just a visible sequential number?

YES the Auto Number I will use as the Key.

Thank you for the Solution, I will try it.