This UNIQUE KEY is killing me

This should be easy based on the articles out there but I’m running into problems. I’ve purposely added a column in my Google Spreadsheets called RECORDID so I may assign it =UNIQUEID() in the Column editor in the initial value; however, I’m getting all kinds of errors and I can’t figure out why.

It says.
The key column ‘RECORDID’ of table ‘ACTIVITY DATA’ is not a legal key because it contains a Formula. - I’ve removed all formulations and the whole column is blank in google sheets. Do you think RECORDID is included in as part of a named range in my google sheets this is causing the error? Could it be if somewhere on my sheet references the RECORDID this would cause the problem? Again, there is no formulation in the column.

This has prompted the editor to choose RowNUM as my default key which I’m trying to avoid.

I just want to move pass this issue :D.

4 Likes

Just want to confirm Steve’s idea above - if you’ve connected a spreadsheet that has formulas, they’ll remain in your column definitions (what Steve highlighted) even after you remove the formula from the sheet - you’ll need to delete them in the app def as well.

2 Likes

@Peter Thanks guys! Worked. My previous formulation was in there and I removed it thanks to that screen shot by Steve. All of the errors went away except that my data no longer shows in the app when I set the RECORDID as the key. However, if I switch the RowNum and RECORDID as the key my data shows. Is it okay to have TWO unique keys then in a table?
Thanks
Tony!

You need to put some value in the RECORDID column in the source table. Data without key will not be shown in AppSheet.

3 Likes

Okay will try that! Any parameters on what the values could be? UNIQUEID is a combination of random letters and numbers of up to how many characters?

How many rows you have in the data? if it is not many, you can just put like ID1, ID2, ID3, etc. As long as they are unique / no duplicate key.

For the next row New record data, with the Initial value UNIQUEID() already set-up, Appsheet will fill in the text key.

3 Likes

For reference:

1 Like

See https://help.appsheet.com/en/articles/1726606-manually-generating-uniqueid-key-values

1 Like