Hello!
I have in my table a field Uniqueid(), but users want to also have an incremented number (1, 2, 3.. etc), so I have a virtual column (VC) with a formula (using Max([column)+1) , and an action (set the values of some columns..), where I set for [column] the value of the VC. This action is "added" to Save button, so when users touch the save button, this action grouped with other actions are used. But I have a situation here: something wrong happens if 2 users click on Save at the same time, there is an error of Unique key violated in my Postgresql, a new row is recorded in my table, but with the incremented number = 0, and this error blocks all other records.
I tried to use a Serial Column in postgresql db, but there is a conflict: in my table in postgresql incrementing` works well, but if I regenerate the schema, so I add this column in my table from appsheet, the column must have a value, (not null condition expected by Serial Type in posgresql), and if I set an initial value =0, then, in posgresql the incrementation is not working anymore, the fields is always set to 0.
Could someone give me an idea how should I handle this issue?
Thank you!
Regards!
Ruxandra
Solved! Go to Solution.
Hello!
It is ok now, I unchecked the "editable_if" field, I kept the incremention in posgresql using bigserial; someone answered me here on this topic, but he deleted his message, so, I was not able to checked as solution. So for this problem, see below, the solution given by him is to set to false the field "editable_if" in appsheet, and it works very well now. Many thanks to Gustavo!
@Ruxandra wrote:I tried to use a Serial Column in postgresql db, but there is a conflict: in my table in postgresql incrementing` works well, but if I regenerate the schema, so I add this column in my table from appsheet, the column must have a value, (not null condition expected by Serial Type in posgresql), and if I set an initial value =0, then, in posgresql the incrementation is not working anymore, the fields is always set to 0."
User | Count |
---|---|
34 | |
8 | |
2 | |
2 | |
2 |