Forum Discussion

MikeTamoush's avatar
MikeTamoush
Qrew Commander
2 years ago

Possible to have a field that checks if a User is in a group or has access?

Is there any way for a formula field to check either one of the following:

1. If a user has access to the app
2. If a user is part of a user group

I have an employee list that automatically imports (synced to box). If an employee is suddenly inactive, I need to know to deny them as a user and remove them from the user group. I possibly can have a notification sent when a user is marked inactive, but I am not sure if notifications fire that way (from a sync)? It would also need to be a multi change message since a lot will be marked inactive at once. I would rather just have a subscription where it looked if a user was marked inactive, but has access to the app.



------------------------------
Mike Tamoush
------------------------------
  • Hi Mike, have you tried using our UserRoles function? Rather than look specifically for user groups, you should be able to check whether a given user is currently assigned any roles in the app. And that will cover roles assigned both as an individual user, and as part of a group. There's more info on the function here: https://login.quickbase.com/db/6ewwzuuj?a=dr&rid=201&rl=eaa



    ------------------------------
    Brian Cafferelli
    Product Marketing Manager | Quickbase
    ------------------------------
    • MikeTamoush's avatar
      MikeTamoush
      Qrew Commander

      This almost works, but it looks like the UserRoles function can only get the current users roles. I would need to be able to point at a user field and say, what user roles is that user in? That way I could say something like, If User is Not active, and userroles<>"", then send me a message letting me know to remove from user roles.



      ------------------------------
      Mike Tamoush
      ------------------------------
      • MattStephens's avatar
        MattStephens
        Qrew Cadet

        Hi Brian, I'm having the same issue and would love to have the UserRoles function for a particular user, not just the current user.

        How easy would it be to add an optional second parameter to the function so that it still works for existing formulas, but also works for other users.

        Still have this:

        UserRoles ("ID/Role/Empty")

         

        But also have this:

        UserRoles ("ID/Role/Empty", user x)
        Description: Returns information about the user x's role. Use in a Formula-Multi-select text field. Usage examples, based on user x's role, include showing or hiding form elements, validating data, sending a webhook or email notification, or dynamic instructional text.

        Example: UserRoles("ID", [record owner]) returns the role ID. of the record owner. UserRoles("Name", [last modified by]) returns the role name of the user who last modified the record . UserRoles("", [record owner]), or empty, returns the role ID and name in the format ID/name of the record owner.