Hi,
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.
Any suggestion ?
Solved! Go to Solution.
In the app editor, go to the tableโs configuration, find the Are updates allowed? property, and click on the flask icon:
After clicking the flask icon, click in the expression bar to open Expression Assistant:
From Expression Assistant, remove any expression already present and replace it with this:
IF(
IN(UserEmail(), coefficient FG MO[Usermail]),
"UPDATES_ONLY",
"ADDS_ONLY"
)
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.
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.
Hi Steve,
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.
In the app editor, go to the tableโs configuration, find the Are updates allowed? property, and click on the flask icon:
After clicking the flask icon, click in the expression bar to open Expression Assistant:
From Expression Assistant, remove any expression already present and replace it with this:
IF(
IN(UserEmail(), coefficient FG MO[Usermail]),
"UPDATES_ONLY",
"ADDS_ONLY"
)
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.
Thanks Steve Working great !
User | Count |
---|---|
33 | |
29 | |
29 | |
20 | |
18 |