Hi everyone! I’m in the middle of creating an Inventory Management App for my client. So far, all your tutorials have been so very helpful and easy to understand.
But my question is, my client has a list of products already with its own Product Code. But I want to create an ID as a Key for the table. Can I generate UniqueID automatically for those existing information already in Google Sheet or do I have to encode them again one by one to generate a UniqueID? I was hoping I can generate it automatically cause the list of products is about 50+ and it would save me a lot of time.
You could have the Google Doc run a function on the new ID column to create unique IDs. Then once done remove the function so new rows have the UniqueID created by Appsheet.
No matter how you will generate key values for initial data. But remember to generate really unique values within column. In my apps Im always use simply incrimented numbers 1,2… for initial data keys
This is the equivalent formula of UNIQUEID() in Google Sheet:
DEC2HEX( RANDBETWEEN(1; 4294967296); 8 )
To use it, paste this formula in an empty column for as many rows as you need, then copy the generated results, then go to your ID key column and choose Paste Values only. Then remove the column that you used in the beginning.
Changing the locale to US, the semicolons in the formulas changed automatically to commas. I changed them back to semicolons, and the formulas where accepted.
Changing back to a European locale, the commas changed automatically to semicolons. Changing them back to commas, the formulas resulted in an error.
So it seams that semicolons are accepted by Google Sheet anyway, but commas will only work for US or similar locales.
Just wonder: i use that formula for my existing rows of data.
Then for the new records i use uniqueID() from within AppSheet.
If i need to add new massive records that i add directly in my GoogleSheet is it possible to overwrite the whole column where i’ve my uniqueID codes with new uniqueID codes or i need to leave the old codes for the old records ?
If your app includes References between tables - AppSheet Help it’s crucial to leave existing key values in place since one table’s keys also exist in other tables.
Potentially. It’s only safe to revise those key values if they exist in only one place–e.g., not in other tables, not in other columns in the same table, not in the app on your or another user’s device from which the rows could be edited, not in any in-progress automation runs.
To be sure which is the best way to create new key values for the new massive records to add directly in Google Sheets without change/overwrite the old keys of existing records ?