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: Salesforce Floe Example

    • Getting Started with Salesforce Flow – Part 46 (Is Your Chatter Group Data Clean? No? Use Flow to Do So!)

      Posted at 2:42 AM by Rakesh Gupta, on December 5, 2020

      Big Idea or Enduring Question:

      How do you provide a way for deleting the Chatter group feed to the key users? 

      Chatter Group is primarily geared towards boosting collaboration among users within an organization. Similar to a public group, a Chatter group comprises a set of users. Indeed, one can add unlimited users to a Chatter Group.

      Some time the Chatter group is very cluttered that as a manager, you want to delete the old post. There are a few apps available on AppExchange for this purpose, but nothing comes out-of-the-box. In this article, we will create automation that allows users to delete a specific type of posts for Chatter groups.

      Objectives:

      This blog post will help us to understand the following

      • Use a Screen a flow to take the user input 
      • How to delete the records using the delete records element 
      • Understand how to create a custom permission
      • Understand how to use custom permission to hide a component 

      Business Use Case

      Brenda David is working as a System administrator at Universal Containers (UC). She has received a requirement from the management to create a wizard that allows a set of users to delete posts (created before a specific date) from Chatter groups. 

      Automation Champion Approach (I-do):

      While this can be solved using various tools:
      1. Manual Deletion
      2. Lightning Web Component 
      3. Apex Code
      4. Data Loader

      We will use Salesforce Flow to solve it. 

      Before proceeding, ahead, understanding CollaborationGroupFeed objects in Salesforce. It represents a single feed item on a Chatter group feed.
      Field Name Details
      ParentId The Id of a chatter post. 
      LastModifiedId It is the date and time when a record was last modified by a User.

      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 Screen Flow. We must:

      1. Salesforce Flow Steps: (Screen Flow)
        1. Create a text variable to store chatter group id
        2. Add a screen to capture the user data
          1. Add a screen component
          2. Add a Date component 
        3. Add a get record element to find collaboration group feeds created before a given date
        4. Add a decision element to check the record collection variable (from step 1.3)
        5. Add a delete records element to delete chatter posts
      2. Creating a custom permission
      3. Assign custom permission to the system administrator profile  
      4. Add flow to the chatter group page and add filter criteria 

      Step 1.1: Salesforce Flow – Create a Text Variable to Store Chatter Group Id

      The Screen flow which we are creating will be used in the Chatter group Page to delete posts. 

      1. Click Setup.
      2. In the Quick Find box, type Flows.
      3. Select Flows then click on the New Flow.
      4. Select the Screen Flow option and click on Next and configure the flow as follows: 
        1. How do you want to start building: Freeform
      5. Under Toolbox, select Manager. Click on the New Resource. 
      6. Input the following information:
        1. Resource Type: Variable
        2. API Name: varTCollaborationGroupId
        3. Data Type: Text
        4. Default Value: {!$GlobalConstant.EmptyString}
        5. Check Available for Input
        6. Check Available for Output
      7. Click Done. 

      Step 1.2.1: Salesforce Flow – Add a Screen Element 

      1. Under Toolbox, select Elements. Drag and drop Screen onto the canvas. 
      2. Input the following information:
        1. Enter Label the API Name will auto-populate.
      3. Click Done. 

      Step 1.2.2: Add a Date Component to Allow Users the Enter Date to Delete Past Chater Posts 

      1. Under Input section on Screen Element. Drag and drop Date onto the screen. 
      2. Input the following information:
        1. Enter API Name.
        2. Label: Enter Date
        3. The API Name will auto-populate
        4. Require: True 
      3. Click Done.

      Step 1.3: Salesforce Flow – Adding a Get Record Element to Find Collaboration Group Feeds Created Before a Given Date

      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 Record CollaborationGroupFeed object from the dropdown list.
      5. Select All Conditions Are Met (AND).
      6. Set Filter Conditions
        1. Row 1:
          1. Field: ParentId
          2. Operator: Equals
          3. Value: {!varTCollaborationGroupId}
        2. Click Add Condition
        3. Row 2:
          1. Field: LastModifiedDate
          2. Operator: Less Than or Equal
          3. Value: {!Enter_Date}
      7. How Many Records to Store:
        1. select All record
      8. How to Store Record Data:
        1. Choose the option to Automatically store all fields. 
      9. Click Done.

      Step 1.4: Salesforce Flow – Using Decision Element to Check the Record Collection Variable (from step 1.3)

      Now we will use the Decision element to check the Record Collection Variable from step 1.3 to find if it returns the record(s) or not. 

      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 Outcome: All Conditions Are Met (AND)
        1. Row 1:
          1. Resource: {!Find_Feeds}
          2. Operator: Is Null 
          3. Value: {!$GlobalConstant.True}
      6. Click Done.

      Step 1.5: Salesforce Flow – Delete Records – Delete Chatter Group Posts

      The next step is to add a logged-In user to the chatter group. We will use the Create Records element. 

      1. Under Toolbox, select Elements. Drag and drop Create Records onto the canvas. 
      2. Input the following information:
        1. Enter Label the API Name will auto-populate.
        2. How Many Records to Create: One
        3. How to Set the Record Fields: Use the IDs stored in a record variable or record collection variable
        4. Select Record(s) to Delete
          1. Record or Record Collection: {!Find_Feeds}
      3. Click Done.

      In the end, Brenda’s Flow 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. Type: Screen Flow
      5. API Version for Running the Flow: 51
      6. Interview Label: Clean Chatter Group {!$Flow.CurrentDateTime}
      7. Click Save. 

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

      Step 2: Creating a Custom Permission 

      By using custom permissions, you can grant users access to custom apps. In Salesforce, you can use custom permissions to check which users can access certain functionality. Custom permissions let you define access checks that can be assigned to users via permission sets or profiles – similar to how you assign user permissions and other access settings. You can even use custom permission to bypass the validation rule for certain users or profiles. Let us create custom permission to hide the flow component. 

      1. Click Setup.
      2. In the User Interface, type Custom Permissions.
      3. Click on the New button.
      4. Enter Label the Name will auto-populate. 
      5. Click Save.

      Step 3: Assign Custom Permission to the System Administrator Profile 

      1. Click Setup.
      2. In the User Interface, type Profiles.
      3. Open the System Administrator profile. 
      4. Then navigate to Apps | Custom Permission and click on the Edit button.
      5. Now, assign the Clean Group Posts custom permission to the profile.
      6. Click Save.

      Step 4: Add a Flow to Lightning Page and Add Filter Criteria 

      The next step is to distribute a flow to Lightning Experience or Salesforce app users, by embedding it in a Lightning page.

      1. Navigate to App Launcher and click on the Groups.
      2. Open any Chatter Group and Edit the page.
      3. From the Lightning Components pane on the left, drag the Flow component onto the Lightning page canvas.
      4. Input the following information:
        1. Select Clean Chatter group flow
        2. for varTCollaborationGroupId
          1. Select Pass record ID into this variable checkbox
        3. Click + Add Filter
        4. Set Filter Conditions
        5. Row 1:
          1. Field: Permission > Custom Permission > Clean_Group_Posts 
          2. Operator: Equal
          3. Value: True
      5. Click Done.

      Once everything looks good, click the Save button. 

      Proof of Concept

        1. As of now UC Internal Announcements – Chatter Group has three posts that were created before November 19, 2020.
        2. Now let’s delete the chatter created on or before November 18, 2020.
        3. BOOM now checks UC Internal Announcements – Chatter Group Feed, are chatter posts created on or before November 18, 2020, were deleted.

      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, Salesforce Flow | 4 Comments | Tagged cahtter feed, Chatter, Chatter Free User, Chatter Group, Chatter Groups, CollaborationGroup, CollaborationGroupFeed, Custom link, data management chatter, Deleet feed, deleet lookup, dynamic choice, flow, Follow Chatter Group, Forcedotcom, Home page component, Home page layout, LastModifiedDate, Lightning Flow, Lightning Flow example, limit flow screen, mass deleet feed, New Flow, ParentId, resize flow, resize flow screen, salesforce, Salesforce Floe Example, Salesforce Flow, Screen
    • Getting Started with Salesforce Flow – Part 30 (Reminder Email to Upload Chatter Profile Photo)

      Posted at 10:04 PM by Rakesh Gupta, on December 1, 2020

      Big Idea or Enduring Question:

      How do you automatically send reminder emails to your users to upload a profile photo on Chatter? 

      Chatter is a powerful Collaboration tool for your organization, for both internal users and partners. Each user has a visible profile page containing his Chatter wall as well as information about the user, including an Image. The first thing to do in Chatter is uploading a profile picture to help your colleagues put a face to a name. In Salesforce I have never found Out of a box solution to send a reminder email to users to upload Chatter profile photos. In this article, we will develop an app by using Flow.

      Objectives:

      After reading this blog post, the reader will be able to:

      • Use Schedule-Triggered Flow to find a list of users who doesn’t have a picture uploaded on Chatter 
      • Use Schedule-Triggered Flow to automatically send a reminder email to users
      • Use Schedule-Triggered Flow to run a job that executes every Monday morning at 8:00 am. 

      Business Use case

      Pamela Kline is working as a System administrator at Universal Containers (UC). She has received a requirement from the management to send out a reminder email once a week every Monday at 08:00 am to users who don’t have a Chatter profile photo.

      Automation Champion Approach (I-do):

      There are a few possible solutions for the above business scenario. We will use Schedule-Triggered Flow to solve the requirement. Before we unwrap, let us understand what Schedule-Triggered Flow is. Scheduled Flows are not triggered by an Event on the data; they simply run when a scheduled time arrives. Scheduled Flows run as follows:

      • Once (On a particular date and time)
      • Daily (On a particular date and time)
      • Weekly (On a particular date and time)

      Remember, when a Flow starts, a Flow interview runs for each record that matches the filter criteria – no looping is required. The matching record is stored in the $Record global variable, so you can reference the variable, or its fields, throughout your flow.

      Before proceeding ahead, you have to understand the User object. It Represents a Chatter user profile.

      Field Name Details
      FullPhotoUrl It represents the URL for the user’s profile photo. This field is available even if Chatter is disabled. The URL is updated every time a photo is uploaded and reflects the most recent photo. 

      Now you might be wondering how you can find the list of users from FullPhotoUrl. To understand it better, let’s take a look at the SOQL query in the following screenshot: 

      1. URL ends with profilephoto/005 – It means a user doesn’t have a profile picture
      2. URL ends with some record id (profilephoto/729B0000000Q6RV) – It means a user already uploaded the profile picture.  

      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 3 steps to solve Pamela’s business requirement using Flow. We must: Read the rest of this entry!

      Posted in Chatter, Salesforce Flow, Schedule-Triggered Flow | 4 Comments | Tagged Advance flow, Chatter profile photo, Chatter profile photo email, Chatter profile photo reminder email, Chatter Topic, Chatter topics, email notification, Email notification for CHatter profile photo, Email to upload Chatter profile photo, flow, Flow builder, flow builder in salesforce, flow builders, Flow Designer, Flow exmple, FlowRockstar, Lightning Flow, lightning flows in salesforce, Loop Logic, Record Create, Record Lookup, Reminder email to upload Chatter profile Image, Reminder email to upload Chatter profile photo, Reminder to upload Chatter profile photo, sales force automation software, salesforce automation, salesforce automation tools, Salesforce Floe Example, Salesforce Flow, salesforce flows, salesforce lightning flow, salesforce lightning flow examples, Send email to upload Chatter profile photo, sfdc Dev 401 exam, Slaesforce sales cloud consultant exam, Sobject Collection, Trigger ready flow, Upload Chatter profile photo, Weekly email to upload Chatter profile photo
    • 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 11 (Count Number of records in a Record Collection Variable)
    • Salesforce Spring’21 Release Quick Summary
    • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
    • Getting Started with Salesforce Flow – Part 4 (Need to Redirect a User to a New Record?)
    • Getting Started with Salesforce Flow – Part 10 (Launch a Flow from an Object-Specific Action)
    • Getting Started with Process Builder – Part 30 (Auto-generate Renewal Opportunity With Line Items)
    • Getting Started with Salesforce Flow – Part 33 (Prior Value of a Record in Record-Triggered Flows)
    • Getting Started with Salesforce Flow – Part 1 (Understand, Create & Use Variables in Flow!)
  • Social Media

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