Automation Champion

Automating Salesforce One Click at a Time
Automation Champion
  • Home
  • About Me
    • Testimonials
    • Resources
  • Process Builder
  • Salesforce Flow
  • Pardot
  • Apex
  • Training Details
    • Salesforce Administrator
    • Salesforce Advanced Administrator
    • Platform App Builder
    • Lightning Flow
    • Pardot
    • Sales Cloud
    • Service Cloud
    • Community Cloud
    • Hands-on Excercises
  • My Books
  • Contact Me
  • Tag: Automatically Add New User to Chatter Group Salesforce

    • Getting Started with Salesforce Flow – Part 36 (Automatically Add a New Users to a Chatter Group)

      Posted at 9:48 PM by Rakesh Gupta, on December 2, 2020

      To understand how to solve the same business use case using Process Builder. Check out this article Getting Started with Process Builder – Part 24 (Automatically Add User to a Chatter Group).

      Big Idea or Enduring Question:

      How do you automatically add users into a Chatter Group? 

      Objectives:

      This blog post will help us to understand the following

      • Use After-save Record-Triggered Flow add users to a chatter group
      • Add a Time-dependent action in After-save Record-Triggered Flow
      • What is a MIXED DML error and how to avoid it?
      • Monitor Time-based flow queue

      Business Use case

      Brenda David is working as a System administrator at Universal Containers (UC). Her next assignment is to create a process to auto add a new user to Chatter Group (UC Internal Announcements).

      Automation Champion Approach (I-do):

      The process of creating a new user can involve many steps that have to be repeated for each person. This can become time-consuming for admins. However, this process can be made easier with automation.

      While this can be solved using various automation tools like Apex or Process Builder, we will use After-save Record-Triggered Flow. Check out this article to understand why we are using after-save record-triggered flow for this scenario. 

      Before proceeding, ahead, understanding CollaborationGroupMember objects in Salesforce. It represents a member of a Chatter group.

      Field Name Details
      CollaborationGroupId Represent Id of the Chatter Group
      MemberId Represent Id of the User (Group member)

      Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.

      Let’s begin building this automation process.

      Guided Practice (We-do):

      There are 4 steps to solve Brenda’s business requirement using After-save Record-Triggered Flow. We must: Read the rest of this entry!

      Posted in Chatter, Salesforce Flow | 92 Comments | Tagged Add Member into Chatter group, Add Member into Chatter group Salesforce1, Add Memeber into chatter Group, Add new user to Chatter Group, ADM 201, adm 201 certification, adm 201 salesforce, admin release exam, Advance flow, After-save flow After save flow, Auto add new user to Chatter Group, Auto add new user to Chatter Groups, Automatically add individuals to Chatter Group upon provisioning new user, Automatically Add New User to Chatter Group, Automatically Add New User to Chatter Group Salesforce, Chatter Group, Cloud Flow Designer Workbook, CollaborationGroupId, CollaborationGroupMember, Create record through flow, Evaluate the rule when a record is, flow, Flow builder, flow builder in salesforce, flow builders, Flow Decision Guide, Flow examples, Flow exmple, flow trigger, headless flow, Launch flow from Process Builder, Lightning Flow, lightning flows in salesforce, Mixed Dml, MIxed DML Error, Mixed DML Flow, Mixed DML Soution, New Flow, New User Creation, Process Builder, Process Builder example, Record Create, sales force automation software, salesforce, salesforce automation, salesforce automation tools, Salesforce Chatter Group, Salesforce Flow, salesforce flows, salesforce lightning flow, salesforce lightning flow examples
    • Getting Started with Process Builder – Part 24 (Automatically Add User to a Chatter Group)

      Posted at 8:31 PM by Rakesh Gupta, on May 7, 2015

      To understand how to solve the same business use case using Salesforce Flow. Check out this article Getting Started with Salesforce Flow – Part 36 (Automatically Add New Users to a Chatter Group).

      Big Idea or Enduring Question:

      How do you automatically add users into a Chatter Group? 

      Objectives:

      This blog post will help us to understand the following

      • Create automation associated with creating a new user
      • Automatically add a user to a specified Chatter group
      • How to use the quick action in Process Builder
      • What is a MIXED DML error and how to avoid it?

      Business Use case

      Brenda David is working as a System administrator at Universal Containers (UC). Her next assignment is to create a process to auto add a new user to Chatter Group (UC Internal Announcements).

      Automation Champion Approach (I-do):

      The process of creating a new user can involve many steps that have to be repeated for each person. This can become time-consuming for admins. However, this process can be made easier with automation.

      A few months back, I had written an article Getting Started with Lightning Flow – Part 36 (Automatically Add New Users to a Chatter Group) to discuss a way through which we can auto add a new user to Chatter Group. To achieve it, I had used Flow, Process Builder, and Workflow Rule. I got excellent feedback, so I wanted to share another way to do achieve the same business use case, using the Process Builder and Global Action. 

      While this can be solved using various automation tools like Apex or Flow, we will use Process Builder. This is not something that can be accomplished with Workflow Rules. 

      Before proceeding, ahead, understanding CollaborationGroupMember objects in Salesforce. It represents a member of a Chatter group.

      Field Name Details
      CollaborationGroupId Represent Id of the Chatter Group
      MemberId Represent Id of the User (Group member)

      Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.

      Let’s begin building this automation process.

      Guided Practice (We-do):

      There are 8 steps to solve Brenda’s business requirement using Process Builder. We must: 

      1. Create a chatter group
      2. Find the chatter group Id
      3. Creating a custom label to store chatter group Id
      4. Define process properties
      5. Define evaluation criteria
      6. Define process criteria
      7. Set time for actions to execute
      8. Add action – quick actions 

      Step 1: Create a Chatter Group

      1. Navigate to App Launcher and click on the Groups.
      2. Clicks on the New button. 
      3. Name the Group and make sure to select the Private Access Type.
      4. Click Save.

      Step 2: Find the Chatter Group Id for UC Internal Announcements 

      The next step is to find out the Id of the chatter group UC Internal Announcements. One possible workaround is to use the Developer Console. 

      1. Click Setup | Developer Console 
      2. In the Query Editor, run the following SOQL query 
        1. Select id, name from collaborationgroup where (name=’UC Internal Announcements’)
      3. Make sure to copy the Id. 

      Step 3: Creating a Custom Label to Store Chatter Group Id

      1. Click Setup.
      2. In the User Interface, type Custom Labels.
      3. Click on the New Custom Label button.
      4. Enter Short Description the Name will auto-populate. 
      5. Now enter the UC Internal Announcement chatter group id in the Value.
      6. Click Save.

      Step 4: Define Process Properties

      1. Click Setup.
      2. In the Quick Find box, type Process Builder.
      3. Select Process Builder, then click New.
      4. Name the Process and click the Tab button. The API Name will populate. 
      5. As a best practice, always input a description. 
      6. The process starts when A record changes.
      7. Click Save.

      Step 5: Define Evaluation Criteria

      1. Click on the Add Object node to begin selecting the evaluation criteria.
      2. Select the User object from the dropdown list.
      3. Start the process only when a record is created.
      4. Click Save.

      Step 6: Define Process Criteria

      1. Click the Add Criteria node to begin defining the process criteria.
      2. Name the criteria.
      3. The criteria should execute actions when the conditions are met.
      4. Set Conditions
        1. Row 1
          1. Field: User | IsActive
          2. Operator: Equals
          3. Type: Boolean
          4. Value: True
      5. Select All of the conditions are met (AND). 
      6. Click Save.

      Step 7: set time for actions to execute

      When DML operations on certain sObjects sometimes referred to as setup objects (such as a User Object), along with, on the non-setup object (such as Accounts), in the same transaction, then, a Mixed DML error is thrown at a User.

      The Mixed DML error is generated – when a User performs DML actions on Setup and non-Setup Objects in the same transaction -because some sObjects affect the user’s access to records in the org. Therefore, a user must insert or update these types of sObjects in different transactions to prevent operations from happening with incorrect access-level permissions. For example, a user cannot update an account, and a user role, in a single transaction. However, deleting a DML operation has no restrictions (reference Salesforce help).

      We are adding time delays to avoid MIXED DML Errors.

      1. Below Scheduled Actions, click Set Schedule.
      2. Set Field Values:
        1. Row 1:
          1. 0
          2. Hours
          3. After
          4. CreatedDate
      3. Click Save.

      Step 8: Add Action – Quick Actions

      1. Below 0 Hours After CreatedDate Scheduled Actions, click Add Action.
      2. For Action Type, select Quick Actions. 
      3. Name the action.
      4. Filter Search By: Type
      5. Type: Create a Record
      6. Action: NewGroupMember
      7. Set Quick Action Field Values:
        1. Row 1:
          1. Field: Member ID
          2. Type: Field Reference 
          3. Value: User | ID
        2. Click Add Row
        3. Row 2:
          1. Field: Related Record ID
          2. Type: Formula
          3. Value: System Variable | Label | UC_Internal_Chatter_Group_ID
      8. Click Save.

      Almost there! Once everything looks good, click the Activate button. 

      Note:- Before you activate your process, you will want to make sure that you have assigned data in the correct format because Process Builder obeys validation rules. If some fields are required by using validation rules, then make sure you have added those fields. Conversely, if some fields are required on the page layout, you can ignore those fields.

      Proof of Concept

      Now onwards, if a system administrator creates a new user, then Process Builder will automatically trigger and add the user to the UC Internal Announcement Chatter group.

      1. Now create a new user via the UI
      2. Once the user is created, they are automatically added to the chatter group UC Internal Announcements within a few seconds, as shown in the following screenshot:

      Check Paused Flow Interviews 

      1. Click Setup.
      2. In the Quick Find box, type Paused Flow Interviews.
      3. Now you will see all action waiting for execution. 

      Independent Practice (You-do):

      Automatically add a user to a different user group based on their role or profile. 

      Formative Assessment:

      I want to hear from you!  

      What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

      Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

      Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

      Posted in Chatter, Process Builder, User Management | 15 Comments | Tagged Add Criteria Proces builder, Add Member into Chatter group, Add Memeber into chatter Group, Add new member to Chatter group, Add new member to Queue, Add new membwer to Public Group, Add new user to Chatter Group, ADM 201, adm 201 certification, adm 201 salesforce, admin release exam, Auto add new user to Chatter Group, Auto add new user to Chatter Groups, Automatically add individuals to Chatter Group upon provisioning new user, Automatically Add New User to Chatter Group, Automatically Add New User to Chatter Group Salesforce, Chatter, Chatter Group, CollaborationGroupId, CollaborationGroupMember, Con 201, dev 401, DEV401, developer release exam, Enable Process Builder, Evaluate the rule when a record is, Evaluate the rule when a record is created, Getting started with Process Builder, How to activate Process builder, how to use Process builder, Lightning Flow example, Lightning Process builder, Mixed Dml, MIxed DML Error, Mixed DML Flow, Mixed DML Soution, Process Builder, Process Builder example, Process Builder examples, Process Builder Salesforce, Process builder use case, Quick action process builder, Quick action process builder example, Quick action process builder examples, Quick action Salesforce Process builder, salesforce, salesforce Admin exam, salesforce certified developer exam, Salesforce Certified Sales Cloud Consultant, salesforce chatter, Salesforce Chatter Group, Salesforce maintenance exam, Salesforce release exam, Salesforce release exam dates, Salesforce release exams, Time based action in process builder, Use case for process builder quick action
    • Search

    • Upcoming Trainings

      Salesforce Administrator Certification
      Salesforce Advanced Administrator Certification
      Salesforce Platform App Builder Certification
      Lightning Flow & Process Builder
      Advanced Lightning Flow
      Pardot Specialist & Consultant Certification
      Sales Cloud Consultant Certification
      Service Cloud Consultant Certification
      Community Cloud Consultant Certification
    • Sponsor #1

    • Sponsor #2

    • Sponsor #3

    • Sponsor #4

    • Order Now!

    • Buy My Book

    • Buy My Book

    • Recent Posts

      • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
      • Streamline Data Collection with Salesforce-Connected Forms
      • Getting Started with Salesforce Flow – Part 56 (Merge Chatter Topics with the Help of Salesforce Flow)
      • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
      • Getting Started with Salesforce Flow – Part 55 (Add or Remove Followers to a Record with the Help of Salesforce Flow)
    • Salesforce ID Converter Build on Lightning Flow

      Converting 15 digit ID to 18 digit Salesforce ID
    • Blog Archives

    • Categories

  • Information

    • About Me
    • Affiliate Disclaimer
    • Contact Me
    • Privacy Policy
  • Top Posts

    • Learning Flow
    • Learning Process Builder
    • Getting Started with Salesforce Flow – Part 27 (Want to Send an HTML Email from Salesforce Flow? Oh, yes! It can be done!)
    • Getting Started with Salesforce Flow – Part 11 (Count Number of records in a Record Collection Variable)
    • Salesforce Spring’21 Release Quick Summary
    • Getting Started with Salesforce Flow – Part 4 (Need to Redirect a User to a New Record?)
    • Getting Started with Salesforce Flow – Part 31 (Auto Submit Record into Approval Process with Flow)
    • Getting Started with Salesforce Flow – Part 44 (Auto Convert Marketing Qualified Leads)
    • Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
    • Learning Pardot
  • Social Media

    • View Automationchampion’s profile on Facebook
    • View Automationchamp’s profile on Twitter
    • View Rakeshistom’s profile on GitHub