How to add a user to Chatter group automatically when it is created or edited?
|Knowledge Article Number||000222113|
|Description||Use Case: An Organization wants to add newly created support users to be added to specific public group as soon as the new users are added in the system. This is to ensure that they get technical/process updates in a timely manner.|
|Resolution||Below mentioned is an example which shows how to add user to Chatter group automatically when a user record is created with specific profile.
Follow these steps:
Step 1: Create Global Actions
1. Click on your Name | Setup | Create | Global Actions
2. Click on New Action button.
3. Select the options as mentioned below:
5. Modify the Layout and Save it as you need it.
Step 2: Create Chatter Group
Refer to the below link for creating Chatter groups:
Step 3: Create a Process
1. Click on your Name | Setup | App Setup | Create | Workflow & Approvals | Process Builder
2. Click New to create a new Process
3. Define Process Name, API Name and (optionally) Description
4. Click Save
Step 4: Choose Object and Specify When to start the Process
1. Click on Add Object element and Select User from the list.
2. Under Start the process, select when a record is created and edited.
3. Click Save
Step 5: Define Criteria
1. Click Add Criteria
2. Define the Criteria Name
3. Under Criteria for Executing Actions select Conditions are met
4. Under Set Conditions select the field--> [User].IsActive Select Operator as Equals--> True
5. Under Conditions select All of the conditions are met(AND)
6. Click Save
Step 6: Define Immediate Actions
1. Click Add Action under Immediate Actions
2. Select the Action type as Quick Actions
3. Define Action Name
4. Select below options as mentioned:
1. Click Activate at the top right hand corner of the screen to activate the process
2. Click Ok on Activate Version screen
Your Process is now active and would help you add user to Chatter group automatically when it is created or edited.
Please note that this example will result on every User edited to be added to the Group defined in the criteria. There's no additional criteria or filter logic.
You can amend this example and add logic based on your business needs using different Profiles, Chatter Groups or other criteria that you may need.