- I have a “employee” table with one column being “email”
- I have another table called data where each employee can enter multiple rows.
- I created access rules as follows:
if user.Email == data.Email allow R U C D
This was working so far.
- Then I changed “email” column in data table to be a reference column in “employee” table.
This is where access rule broke. I am not able to figure out how to match logged in user’s email with table’s email’s field when the field is a reference.
Your rule says data.Email
but I assume you mean rec.Email
. Since that’s a reference to the employee table (that just happens to display an email), I suggest renaming the column to Employee
. Then use this formula:
user.Email == rec.Employee.Email
Here rec
is the record of the ‘data’ table, and rec.Employee
is the referenced record of the employee table.
Alternatively, take a look at the setup in the video in Intro to access rules - Grist Help Center titled “Understanding reference columns in access rules”.
Thank you. Instead of matching email, I had to switch to matching record id. Now it is working.