Forum Discussion

blitz2384's avatar
blitz2384
Copper Contributor
Mar 12, 2021

disable button

i have submit button that must be disabled for reporting users.

users are maintained in the below list info

please help

Usergroup list

Title  username permissions

AA      John          Reporting

  • DogAndPonyShow's avatar
    DogAndPonyShow
    Copper Contributor

    blitz2384 

     

    You could try this:

    On the DisplayMode property of the 'Submit' button, add the following expression:

     

    With({usrRoles: LookUp('AccessControl', User.Email=User().Email, AccessLevel)},

    If("Reporting" in usrRoles.Value, DisplayMode.Edit, DisplayMode.Disabled)

    )

     

    'AccessControl' is the name of the list, so in your case it's 'Usergroup'

    AccessLevel is the column name the roles are on.  It will need to be a choice column for this to work.

    "Reporting" is the role you want the button to be enabled for.

     

    You may need to change User.Email=User().Email to username.Email=User().Email

     

    The 'User' / 'Username' column should ideally be a people column.  The above example extracts the email address from the value.

     

    Using the above example, if "Reporting" is in the AccessLevel against the user it'll set the DisplayMode of the button to Edit, otherwise it will disable it.

Share