Getting Started with Salesforce Flow – Part 38 (Reminder For Chatter Group Pending Membership Requests)

Getting Started with Salesforce Flow – Part 38 (Reminder For Chatter Group Pending Membership Requests)

Last Updated on September 12, 2021 by Rakesh Gupta

Big Idea or Enduring Question:

  • How can you send an automatic email alert to Chatter Group Owners about pending membership requests?

In Salesforce, a Chatter Group represents a group of users. It’s a great way to boost collaboration in your organization. You can add unlimited members to a Chatter Group, but a user can only join a maximum of 100 groups. If the Chatter Group is set to Private, then the user has to request to join. Salesforce will send an email to all group Owners and managers. However, what if the Group owners or managers forgot to take action? Salesforce never sends a reminder email.

Objectives:

After reading this blog, you’ll be able to: 

  • Use Schedule-Triggered Flow to check for Pending Chatter Group Requests 
  • Use Schedule-Triggered Flow to automatically send a reminder email to the Chatter Group Owner

Business Use Case

Pamela Kline is working as a System administrator at Universal Containers (UC). She has received a requirement to develop an automated process that will send email reminders to private Chatter Group owners of pending member requests to join the group. 

Automation Champion Approach (I-do):

There are multiple ways to solve the above business requirement. You can either use Apex trigger, Salesforce Flow, Process Builder, and more. To solve this requirement, we will use Scheduled-Triggered Flow.

Before proceeding ahead, you have to understand the CollaborationGroupMemberRequest object. It represents an entry in the feed, such as changes in a record feed, including text posts, link posts, and content posts.

Field Name Details
CollaborationGroupId  The Id of the private Chatter group.
RequesterId The ID of the user requesting to join the group
Status The status of the request. Available values are: Accepted, Declined, Pending

Also, understand CollaborationGroup object. It represents a Chatter group

Field Name Details
CollaborationGroup The type of Chatter group. Available values are: Public, Private, Unlisted 

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 Pamela’s business requirement using Schedule-Triggered Flow. We must:

  1. Define flow properties for schedule-triggered flow
  2. Add a get records element to find pending members 
  3. Add a decision element to check if pending membership request exist 
  4. Add a core action send email to send out an email

Step 1: Salesforce Flow – Define Schedule-Triggered Flow Properties 

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows then click on the New Flow.
  4. Select the Schedule-Triggered Flow option and click on Next and configure the flow as follows: 
    1. How do you want to start building: Freeform
    2. Set Schedule
      1. Start Date: Dec 16, 2020
      2. Start Time: 8:00 AM
      3. Frequency: Daily
      4. Click Done.
    3. Select Object: CollaborationGroup
    4. Select All Conditions Are Met (AND)
    5. Set Conditions
      1. Row 1
        1. Field: CollaborationGroup | CollaborationType
        2. Operator: Equals
        3. Value: Private
    6. Click Done.

Step 2: Salesforce Flow – Adding a Get Record Element to Find Pending Membership Request 

The Get Records element will check whether any pending membership requests exist for a private Chatter group.

  1. Under Toolbox, select Element
  2. Drag-and-drop Get Records element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Select the Group Member Request object from the dropdown list.
  5. Select All Conditions Are Met (AND)
  6. Set Filter Conditions
    1. Row 1:
      1. Field: CollaborationGroupId
      2. Operator: Equals
      3. Value: {!$Record.Id}
    2. Click Add Condition 
    3. Row 1:
      1. Field: Status
      2. Operator: Equals
      3. Value: Pending 
  7. How Many Records to Store:
    1. select Only the first record
  8. How to Store Record Data:
    1. Choose the option to Automatically store all fields
  9. Click Done.

Step 3: Salesforce Flow – Using Decision Element – Does Pending Membership Exist? 

Now add the Decision element to decide whether or not to automatically send an email. If the Resource (variable) is null, then it means there are no pending requests for membership. You can take help from the screenshot below:

  1. Under Toolbox, select Element
  2. Drag-and-drop Decision element onto the Flow designer. 
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Under Outcome Details, enter the Label the API Name will auto-populate.
  5. Condition Requirements to Execute OutcomeAll Conditions Are Met (AND)
    1. Row 1:
      1. Resource: {!Find_Pending_Membership_Request}
      2. Operator: Is Null 
      3. Value: {!$GlobalConstant.False}
  6. Click Done.

Step 4: Salesforce Flow  – Add Send Email Core Action to Send Out an Email 

Now we will use the Send Email static action to send out an e-mail to the Chatter group owner. 

  1. Under Toolbox, select Element.
  2. Drag-and-drop Action element onto the Flow designer. 
  3. Select send Email out-of-the-box action. 
  4. Enter a name in the Label field; the API Name will auto-populate.
  5. Set Input Values
    1. Body: This is a reminder email to let you know that Chatter Group ‘{!Find_Pending_Membership_Request.CollaborationGroup.Name}’ has some pending membership request.
    2. Subject: Pending Chatter Member Request
    3. Email Addresses (comma-separated): {!$Record.Owner.Email}
    4. Rich-Text Formatted Body: {!$GlobalConstant.True}
  6. Click Done.

In the end, Pamela’s Process will look like the following screenshot:   Once everything looks good, perform the steps below: 

  1. Click Save.
  2. Enter Flow Label the API Name will auto-populate.
  3. Click Show Advanced.
  4. API Version for Running the Flow: 51
  5. Interview Label: Auto Reminder Email – Pending Membership {!$Flow.CurrentDateTime}
  6. Click Save.

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

Proof of Concept

From now onwards, if a user requests to join a private Chatter Group, the group’s owner will automatically be emailed at a designated time.

  1. To test this functionality, request to join the private chatter group called UC Internal Announcements.
  2. At the specified time for the Schedule-Triggered Flow, the Group Owner will receive an automated email of pending Chatter Group Member Requests.

Formative Assessment:

I want to hear from you!  

What did you learn from this post, is it relevant to you, and how will you modify the concepts taught in the post for your own business processes? 

Make a post and tag me on Twitter @automationchampusing #AutomationChampion. 

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

2 thoughts on “Getting Started with Salesforce Flow – Part 38 (Reminder For Chatter Group Pending Membership Requests)

    1. It’s a summer’14 feature(Only enabled for administrators or developers) and this feature also available in per-release developer org. You can find more information about send email static action in page number 196

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.