I've run into a new problem with a key column...

(Adrian Enz) #1

I’ve run into a new problem with a key column.

The app is not deployed yet and I have a table that uses a column as key that has a spread sheet formula in it. It works just fine.

The problem is, that everytime I save the app, the key changes to the rownumber column (at the top). Then there comes an error that it is not a suitable key column.

Then I set the cross again to the spread sheet formula column and it works again. Until I save the app again.

Why is that? Can’t I use a spread sheet formula column as key? And if yes, why does it work if I don’t save the app.

Thanks in advance.

Greetings, Adrian

(Aaron Moolb) #2

I think the issue is that the formula is changing the key every time there is a change on the spreadsheet. Key columns cannot change. That would be like a friend giving you his address to come over but then he changes his address while you’re on your way.

(GreenFluxLLC) #3

Hi @Adrian_Enz. What formula are you using for your key column, and where are you entering it?

I would recommend using the UNIQUEID() function, entered

in the “Initial Value”

setting of your key column. This generates a random-text key, so make sure to set the column type as TEXT.

(Aleksi Alkio) #4

@Aaron_Moolb is correct. You can’t use formula behind of key column. It doesn’t matter if it’s an app or sheet formula.

(Praveen Seshadri (AppSheet)) #5

And @Aaron_Moolb has a very cool analogy as well!

Btw, the reason it doesn’t show an error until you Save is that the error checking (the “compilation” of the app) is done only when you save.