Hiding a field based on role using a display formula
You can show and hide fields or screen elements with a Display Formula. Display formulas use JSONata and can reference the current user, row fields, form values, and context data.
For example, to show a field only to owners or authors, set the field or element visibility mode to Show and use:
user.highestRole = 'owner' or user.highestRole = 'author'Another example:
(user.highestRole = 'owner' or user.highestRole = 'author') or $not(user._id in viewers)where user._id is the current user's ID.
This checks that the user is an owner or author, or is not in the row's viewers list. It gives you flexibility to change the interface based on the row viewers and the signed-in user.
You can also check whether the current user created the row:
user._id = userIDDisplay formulas are for interface behavior, not security. Hiding a field or element does not by itself prove that the user cannot access the underlying data. For security, configure row access, field access, Teams, People settings, and Private Data. Use the In-App Debugging when a display rule does not evaluate the way you expect.
Last updated