How can i let the program create key automati...


How can i let the program create key automatically in succession ?

I tried using the function UNIQUEID() but it is giving random key numbers ( Not in succession )

(Aleksi Alkio) #2

What kind of key value are you looking for?

(Fernando López) #3

If the new record it’s been created by many users, the answer is No, you can’t create a sequential key (chevk this . If the creation of the record is managed just by one person you can use this:

In the INITIAL_VALUE option of your ID (or Key) column code this:

=COUNT(YourTable[ID]) + 1

Sequential Keys

(Fernando López) #4

@Suvrutt_Gurjar jejeje I think we’re SYNC

(Aleksi Alkio) #5

Guys… let’s see first what kind of key he is needing :slight_smile:

(Suvrutt Gurjar) #6

@Aleksi_Alkio, Fully agreed. As usual your approach is properly



Good Day,

Example, I have column named [ID]. I am going to insert integers as date in this column. Obviously those numbers dont start from zero. Let us say that number I entered is 201832 first entry when I create a new record, I need the program to increment value by 1. So new record [ID] will be 201833. The function ( =COUNT(YourTable[ID]) + 1 )

you gave me, if first entry is 201832. The second entry by program is 2 not 201833. Your function ( =COUNT(YourTable[ID]) + 1 ) is counting number of entries to give new id.

Thank you all

(Aleksi Alkio) #8

You can use MAX(TableName[ID])+1 in initial value field but please remember that if you have more than one user or one user with two devices, you probably will have duplicates.



Dear brother

Thank you very very very much. this is what I was looking for. It works fine. :slight_smile:

Just in case, is there any other way we can use this function without duplication (If there is more than one user)

(Aleksi Alkio) #10

I’m afraid that won’t be possible.

(Suvrutt Gurjar) #11

Hi @UNITED_SKATEBOARDS Sequential keys

is not a recommended practice. I request you to go through the following article- - Sequential Keys Sequential Keys