0

Is it possible to discover the name of the many users and emails from an group email in Salesforce?

Is there a way to retrieve this information using Apex?

Can I use the Group email as the source for this search?

1
  • 4
    What do you mean by an "email group"?. Please edit your post to give more details and an example. Commented May 21 at 0:07

1 Answer 1

1

The Group object has an Email field. If you query the group table in your org with this given email, should it return one or more groups, you may use the group identifiers to query the GroupMember table through the GroupId field, and by the MemberId on said object you have access to the user identifier, thus having a list of users that belong to that group that is associated with that email.

SELECT Id
FROM Group
WHERE Email = '[email protected]'
SELECT Id, Name
FROM User
WHERE Id IN (
  SELECT MemberId
  FROM GroupMember
  WHERE GroupId IN :groupIds
)

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