I have a few tables that needs to allow only one record per user (as I use a ref to these using a ANY function). But I want this record to remain editable.
I am using this expression as data validity for the limitation :
COUNT(Select(coefficient FG MO[_Rownumber],[Usermail]=UserEmail())) <1
The limitation is working properly. However, the record is not editable (message of invalid entry) as soon as the form is open. No save possibility.
I tried to fix it using :
COUNT(Select(coefficient FG MO[_Rownumber],[Usermail]=UserEmail())) <=1
Then the record become editable but it allow to create another one.
You could use an expression in the table’s Are updates allowed? property to allow the user to add a row only if they don’t already have one, or to only modify their row if it already exists.
I understand the expression COUNT(Select(coefficient FG MO[_Rownumber],[Usermail]=UserEmail())) <1 is not appropriate for what I want to do and your suggestion looks interesting. Any chance to get a clue about the way to write this expression ? I don’t get it as soon as multiple condition are necessary in the same expression.
Steve:
to allow the user to add a row only if they don’t already have one, or to only modify their row if it already exists
This says if the current user (identified by UserEmail()) already has a row in the coefficient FG MO table, only allow that user to read and update (edit) rows of the table; otherwise (if the user doesn’t have a row), only allow the user to read rows and add a row.