Duplicates when using [_RowNumber]

I have an app whereby each job gets allocated [Job Number] based on [_RowNumber]+40000 as an App Formula. The issue seems to be that in certain senarios the following happens:

  • User A starts to adds a record, [Job Number] = 41000 because row 1000 is still blank
  • User B starts to adds a record, [Job Number] = 41000 because row 1000 is still blank
  • User A saves the record so where [_RowNumber] = 1000, [Job Number] = 41000
  • User A saves the record so where [_RowNumber] = 1001, [Job Number] = 41000

I’m thinking the best way to solve this is to have an action on Form Saved to write [Job Number]. Any better suggestions?

1 Like

What you see now is the native behavior of the appsheet.

Run the action (data change for the target columns using [_RowNumber]+40000 expression and invoke this data change action on adding new row event.

You mean using a bot?

yup

I did consider that but I know that a Save Form action would show the result straight awa. But wasn’t sure if a bot would do so as well.

Need a while untile BOT does the job to see the surface of the app (until the sync completes) to see the result of the job of the bot.

1 Like

Turning On Quick sync would solve this issue. I have not specifically tested on this scenario but in my opinion it should solve your issue.

If Job Number is an Key, can a bot still change it?

Im having difficulty changing the key after initial form save.

No, key column is not editable once the record is saved.