Hi @Dmitry_Kuchev and Welcome to the Community !
Maybe something like this would work as a Disable if
formula in your button :
Users.Filter(People = User()).First().Roles = [Role 3]
In my very quick test, this disables the button if the Current user
(User()) was assigned the [Role 3]
Here’s a screenshot of the doc I used to test this, which might be similar to yours
And what the Disable if
formula
Users.Filter(People = User()).First().Roles = [Role 3]
… does is : it takes my table Users
and look for (Filter()
) the row where the CurrentValue.People
is equal to the Current user
(User()
). (and because Filter()
always returns a list of rows, .First()
is there to actually extract the row from the list).
Then, from that row, we get the corresponding role and check if it’s equal to the role for which the button should be disabled .
Another way to do this could be to use MaxBy()
Users.MaxBy(People = User()).Roles = [Role 1]
Something else that might work, if you stored your various roles in a table and use a lookup field to select the role for the people within your Users
table, could be to add a checkbox to the Roles
table to indicate which roles should disable the button and which shouldn’t
(Here I chose Checked
should disable and Unchecked
shouldn’t)
In your Users
Table, you can then gather that value (by adding a related column
from the lookup field) and use a Disable if
formula in your button such as
Users.Filter(People = User()).First().Disable
Which follows the same principle as before, but instead of looking for a specific role, it will check the value of the Disable
checkbox already tied to a specific role
Depending on your actual setup you might need to adapt the Disable if
formulas I shared here , but I hope this will help you a little .