Keys the most unnerving thing ever

I keep trying to give AppSheet a try but OMG i just want to throw my computer out the window. And mind you not I have been doing development for 16 years using php and nodejs.

OK here is my dilemma. I am using a MySql database to hold my table.

Table 1: Equipment
Fields: id (auto increment) / name / model / serial_number / status

Table 2: Equipment_Service
Fields: id (auto increment) / equipment_id / description / service_comment / status

I added both in my appsheet and set up the tables. The system added _RowNumber to each table. I than related the two via the equipmnet_id.

When you try to create a new equipment the equipment_id shows as required and cant be set to blank. Also you can not unself the key option as you will get “key needs to be set”, i than set up the _RowNumber as key but that still did not work.

I than set up the formula to UniqueID() only to get the error “cannot use an app formula”

So what is the point of a key if you cant set it to be automatically unique???

For your key column on your table , push uniqueid() expression into initial value, rather than AppFormula.

[_rowNumber] column is not recommended to use as Key/ID in general, even though AppSheet automatically select it as key, but we need to change arbitrary to other suitable column for key.

3 Likes

wow thank you so much. i have honestly searched for this all over google.

1 Like

Just to add to @tsuji_koichi’s guidance, please use the AppSheet support page to search for AppSheet help artilces and sample apps. There are many helpful articles therein written specifically with AppSheet platform in mind.

https://www.appsheet.com/Support

Please search by keywords such as “key” in this case in the above link and you will get the relevant articles.

For example, the following artilce describes concepts on keys as applicable for AppSheet

4 Likes

The database and AppSheet table (primary) key columns should be the same. The database MUST NOT be assigning the key value; AppSheet MUST assign the key value.

See also:

2 Likes

My comment to you is “indeed” to avoid any problems betweem AppSheet and SQL.

Appsheet is the one to assigne the key value, not SQL to avoid any possible conflict.

2 Likes