
Dev org queries:
select Group.Type, GroupId, Group.DeveloperName, UserOrGroupId from GroupMember where Group.Type = 'Regular'
select Group.Type, GroupId, Group.DeveloperName, UserOrGroupId from GroupMember where Group.Type = 'Queue'
TargetOrg Queries:
select DeveloperName, Id from Group where Type = 'Regular'
select DeveloperName, Id from Group where Type = 'Queue'
select DeveloperName, Id from Group where Type = 'Role'
What fields should I be looked to reference and which object should I be trying to upsert on (Group or GroupMember)?
Thanks!1 answer
Refer this link https://help.salesforce.com/articleView?id=000004831&language=en_US&r=https%3A%2F%2Fwww.google.com%2F&type=1The Data Loader can be used for mass membership changes to Salesforce CRM Public Groups.If you haven't already got it, the Data Loader can be downloaded at:Setup | Data Management | Data LoaderNOTE: To log into Sandbox org: Click on Settings-->Settings on Data Loader's main screen (cancel any function to get to it) and change "Server Host" field to https://test.salesforce.com - then be sure to switch it back to https://www.salesforce.com or just blank it out for production org connections.In the Data Loader, log into your Salesforce CRM Org using your username and password.** EXTRACT GROUP MEMBER LIST **Use the Export function as follows to extract a list of all current members of a group:Click on the check box to Show ALL Salesforce objects and select the object "Group Member"Select Fields: Id, GroupId, UserOrGroupIdSet the SOQL filter to GroupId <equals> then cut and paste the 15-char Group record Id from the URL of that Salesforce Public Group AND click "Add Condition" button to use that filter. Step through remainder of Data Loader wizard.View results in external app (Excel, CSV)** REMOVE GROUP MEMBERS **WARNING: THIS IS DESTRUCTIVE - Use with caution.To remove users from a public group in mass, start up the Data Loader, log into your org, then select the Delete function.Modify your CSV file to have the Id of the public group member(s) to be deleted, that is all.IMPORTANT: This is the Id from the Group Member export extraction. Be sure not to use the Id from Group or User records.Continue through the Data Loader wizard to process the request.WARNING: DO NOT use the GroupId or UserOrGroupId as this would DELETE actual Groups and/or Users.** ADD GROUP MEMBERS**To add new members to a public group, create a CSV file with column headings from the Export extraction above.Remove the Id column (this will be created by the Insert function).Put the 15-char record id from the URL for the Group into the GroupId column.Put the 15-char record id from the URL for the User record into the UserOrGroupId column.Then continue through the Data Loader wizard including mapping fields.