Hi,
When a user submits a forms entry, sometimes s/he overrides the submission of another user.
User A submits the entry, it goes on row 11 of my table.
User B submits an entry, it goes on row 11 of the same table, overriding Userโs A submission.
Any thoughts on why this may be happening?
Thank you,
Magdalena
How is your key column expression? Or might the tableโs key column be the [_RowNumber]?
Youโre welcome
I started using a system generated key
CONCATENATE([Date],": ",[Email])
But I am still having cases where two users (two different emails) override each other.
I donโt need sequential keys. I need:
Any guidance on the key question (pun intended)?
Thank you,
Maiga
@maiga
There is a possibility of the way appsheet is treating the format of your generated key in a wrong way because of the colon (:)
in between the date and email columns. In general, the colon (:)
- indeed itโs a double colon (::)
though - as a reference directive. Your key generation seems allright and unique - as it contains the useremail - but try with changing it like:
CONCATENATE([Date],"-",[Email])
I will try this change @LeventK. Thank you for the very quick reply.
Youโre welcome.
Please post a screenshot of the column list for the table from Data >> Columns in the app editor. Please ensure the screenshot includes both the key and label columns, at least.
Hi @Steve had to break it in 2 screenshots. The tough thing about this is that the user submissions are once a week and it is hard to test if the changes are working. Thank you for taking a look.
You key column, _ComputedKey, appears to be using the expression @LeventK suggested above:
CONCATENATE([Date],"-",[Email])
A problem with this key is that if a single user adds multiple rows in a single day, each additional row will overwrite the previous row, because each added row will have the same key column value. I doubt this behavior is what you want.
I notice you have a column named Uniqueid. I would encourage you to use this column as your key column by making the following changes:
For the Uniqueid column, set the Initial value expression to UNIQUEID()
.
For the Uniqueid column, set the Editable? expression to FALSE
.
For the Uniqueid column, optionally set Show? to OFF.
Delete the _ComputedKey virtual column altogether.
For the Uniqueid column, set Key to ON.
This is very useful @Steve.
I had not understood from any of the documentation that "initial valueโ needed to have the unique formula, I had tried it before and kept getting errors. Thank you for explaining.
When I use uniqueid() users are not able to see their past entries.
I think iโve solved for the problem of multiple entries by same user by switching from a form view to a table view. The user will be able to edit their entry. Iโll see if this works and if it doesnโt Iโll try your solution.
Thank you again for your help.
Maiga
You really need to read and understand the What is a Key? document I posted above. If you donโt understand keys, you will find AppSheet extremely frustrating and confusing.
I see. I thought that I had understood the concept but Iโm missing something. I understand that the key is unique but the other row content can change without messing the key, correct?
Context:
My users do a weekly entry, every Monday. The row is identified with the key
CONCATENATE([Date],"-",[Email])
Users should have 1 entry per week. I want them to be able to go back and edit their weekly entry if necessary (e.g. Wednesday they need to do some changes). Then, the following week, they have a new entry.
Where is the obvious gap in my understanding? Any orientation is much appreciated!
Thanks,
Maiga
Correct.
It appears it is what you want, so @LeventKโs suggestion is a valid one, and my suggestion to use UNIQUEID() is unneeded.
User | Count |
---|---|
44 | |
28 | |
28 | |
21 | |
13 |