'Data: add new row...' does not allow manually inputted key

I can understand why not allowing a ‘Data: set the values…’ action to edit a key column is a good idea.

But why can’t a ‘Data: add new row…’ action be used to manually set a key on a new record?

1 3 540
3 REPLIES 3

Hi @Marc_Dillon! It sounds like you’re trying to add new rows with a manual, rather than an automated, key. You can manually override AppSheet’s key selection as follows:

  1. Open the app in the Editor.
  2. Go to the Data > Column Structure tab, scroll down to the table you want to change, and click Show.
  3. Uncheck the “Key” property for the existing key column.
  4. Check the “Key” property for the column you want to make the key.
  5. If you don’t want to see this column in your app, check the “Hide” property for this column.
  6. Click the blue pen icon to change the column settings, and scroll down to the “INITIAL VALUE” * setting. Change this to UNIQUEID() to generate a unique text code for each row. Note: You can also use RANDBETWEEN(low, high) if you want a numeric key.
  7. Save your changes.

The key value for a record must be assigned once when the record is created and it must remain constant for the life of the record. That is why you must specify the key value in the Initial Value property and never in the App Formula property. The Initial Value property is computed once when the record is created. By contrast, the App Formula is computed once when the record is created and is recomputed each time the record is updated.

I’m also including this link to help provide a bit more information on editing keys. Please let us know if we can provide any additional help.

Happy app building!

Thanks for the response @JCadence. I understand why editing a key is bad. I’m just wondering why this specific action won’t allow you to manually specify a key value for a new record? If there is some reason, then that is fine, but if not, then I would like to request that it gets changed.

Perhaps I did not explain my inquiry sufficiently.

In the following screenshot, notice the Action type (“Data: set the values…”), and notice the blank selection in the column dropdown. 2nd screenshot shows the columns in that table.


2X_3_3cfd512e77403858ddfa4bdc56533d3810a292ef.png

From this I’m assuming that the blank selection is the [adjustment id] column, which is the key column, and it is blank because the system does not want you to edit the value of a key column. That is all good and understandable.

But now we have another action in the next screenshot (the very newly added action “Data: add a new row…”), and we see the same blank choice appearing.

I don’t see any reason why the system would not allow you to specify a value for the key column here in this new action.

Top Labels in this Space