Is there a global variable for referencing public groups

Use case: I want to generate data on a field for few users belonging to a public group.I know using $profile I can do

!IF( $Profile.Name = "System Administrator", "1", "0")

Is there a way for me to check  $user.groupId / $user.groupname??

Please suggest if there is a way where I can generate data for a group than a profile so that I can dynamically add users than changing the formulas every time in production.

1 Answer 1


I'm afraid I don't think you can access group through the global variables. Also the syntax would be interesting as one person can be a member of zero to many groups.
If you are working in a VisualForce page then you can expose this information through a method.
As you suggest you are working in formulas, this option is not available. One possibility you might want to look at would be to have a hierarchical custom setting.
custom setting configuration
Set the default value to be false, and then add an entry for the users (or profiles) that you want to be treated differently by the formula
You can then reference this in a formula and behave differently for those individuals. And you can change who gets the behaviour by updating the users named in the custom setting, without having to amend formulae in production.
Formula definition referencing custom setting
Does this help with your problem?

  • Good approach Doug but the problem would be when the number user who need to be special list increases. If it has to be a profile based setting I always have $profile. I was interested in knowing if there was some way to access group info from $user global variable since there was no direct access to public groups!!! Something like if($user.groupname="Test group","yes","no")
    – Rao
    Jun 17, 2013 at 22:25
  • Ah OK, yes, if you want to stick with profiles maybe there is some natural split in your users and you can create a new profile that will grant the access to the different data. Or would reference to the user role help?
    – Doug B
    Jun 17, 2013 at 22:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .