_RowNumber keeps resetting to be the primary ...

(Matthew Brown) #1

_RowNumber keeps resetting to be the primary key.

I have a field using UniqueID() … what am i missing, what does it default back to row number when i save?

thanks! matt

(Matthew Brown) #2

Google Sheets is source of data.

I did move the key field over, but regenerated.

AppSheet will accept other fields as key field, just not the one i need.

(Steven Coile) #3

@Matthew_Brown Are there any warnings in info / Errors?

(Steven Coile) #4

Wait! So it’s fixed now?

(Matthew Brown) #5

Steve - yes, it is fixed.

I thought I updated this thread earlier saying I figured it out.

Looking back, it did not save. I was wondering why you were so helpful post mortem !

Apologies…here is what happened and how it was fixed:

  1. Used excel function to generate unique id’s within excel google doc 2) the app pulled that formula in from google docs, and popped in in the spreadsheet formula box (behind the field i wanted to be the key) 3) I set it to key, and clicked save, but it kept putting it back to _RowNumber 4) I deleted the formula from SpreadSheet formula box and hit save - still didn’t work 5) went back to google docs, copied and pasted the unique values using “value only” to the correct field 6) went back to app, deleted the formula again (it kept pulling it in), set to key, set the initial value to UniqueID() so new records added from the app are unique, and clicked save 7) it worked then…

bottom line - SpreadSheet formula and Key would not coexist…

again, sorry for the run around, thought I had updated it.

(Steven Coile) #6

@Matthew_Brown Great to hear it’s fixed! Well done!

(Matthew Brown) #7

No - It just automatically set it back to _RowNumber

(Steven Coile) #8

@Matthew_Brown When you say the column is using uniqueid(), how exactly is it using it? Is it in a formula? In the App formula? In the Initial value? Somewhere else?

(Matthew Brown) #9

Initial value. Hidden.

The underlying Google doc had a formula in it that generated a random key.

I wanted app sheet to handle this, not the Google doc.

The formula got in the dark because I had to generate initial values for some of the data I was converting over.

(Steven Coile) #10

@Matthew_Brown “the formula got in the dark”?

(Matthew Brown) #11

Uh! Speech to text with southern accent. The formula was in the app bc I placed it in the google doc (not dark) to generate the initial unique values.

(Steven Coile) #12

@Matthew_Brown If you edit the KEY column configuration, is there anything in the Spreadsheet formula box?

(Matthew Brown) #13

No, nothing there anymore.

Deleted and it worked.

But it wouldn’t accept the field as a unique key when it had the spreadsheet formula box populated.

(Steven Coile) #14

@Matthew_Brown What is the KEY column type?