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: group

    • Parsing Dynamic choice Multi-Select Picklist fields (Flow) – Reusable component

      Posted at 2:49 PM by Rakesh Gupta, on February 4, 2015

      In the last article Add Record to Multiple Chatter Groups – Parsing Multi-Select Picklist fields (Flow) I had discussed the way through which you can Parse Multi-select picklist or Multi-select check-boxes and store Parsed Ids into a collection variable. In this article, I am going to give you a reusable component (Flow) that you can use to Parse Multi-select picklist or Multi-select check-boxes. You have to install this component (Package) in your org, after installation you can use it.

      Business Use case

      Tamara McCleary is working in Universal Container as a system administrator. After user creation, she has to spend few hours to add the user to multiple Public groups. Now she is looking for an application that allows her to add new users to multiple Public Groups without moving to screen-to-screen.

      Steps to Install this app

      I am offering this app as Managed package, you can install it from below URL

      https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB00000001Al4

      To install this app replace Login with your Salesforce instance name in my case this url will look like

      https://gs0.salesforce.com/packaging/installPackage.apexp?p0=04tB00000001Al4

      Note :- For Mismatching Versions error please refer this thread. I have successfully installed this package into multiple org those are upgraded to Spring’15, as I have created it from Spring’15 pre-release org.

      How to use this package as Sub-flow

      Once you have successful  installed this package in your org, after that you can use it as sub-flow. To use this app It’s required one Input fields to pass SCREEN MULTI_SELECT FIELDS into Subflow variable {!SelectedIDs}, as shown in the following screenshot

      Input Field

      Input Field

      One Output fields to reference Subflow Collection variable {!All_Selected_IDS} to flow collection variable, as shown in the following screenshot

      Output Field

      Output Field

      Solution for the above business requirement

      To solve this requirement we will use Visual Workflow, and then we will embed Flow to a custom link. Before proceeding you have to understand Group and GroupMember objects in Salesforce.

      1. Group :- This Group object represents Queue and Public Group both. Groups are sets of users.  A Group can contain individual users, other groups, the users in a particular role. By using Type field you can distinguish between Queue and Public Group. For Public Group (Use Type = Regular) and for Queue (Use Type = Queue).
      2. GroupMember :- Represents a User or Group that is a member of a public group.

      Note:- In this article I will only discuss about adding user into Public groups . In similar fashion you can develop a flow for the Queue.

      1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
      2. Click on New Flow, it will open flow canvas for you. Create One Text variable UserID (To pass the User ID from custom URL – to whom you wants to add into multiple Public Groups). Next step is  allowing users to select multiple Public Groups. To do that drag-and-drop a Screen Element ( Give the name Select Public Groups) onto the window and add a Dynamic choice Multi-Select check-box field with below detail

      Name Data Type Required
      Public Groups Multi-Select Checkbox Yes

      It will look like the below screenshot

      Dynamic choice Multi-select checkbox

      Dynamic choice Multi-select checkbox

      3. Create a collection variable {!All_IDs_In_One} as shown in the flowing screenshot to store the parsed IDs

      Collection Variable

      Collection Variable

      4. Next step is to parse Multi-select check-box values into a collection variable. To do this drag-and-drop Flow MSP to Collection Variable onto the window and map Input/Output Variables assignment. Please refer to the following screenshot for more details

      Input and Output Variables assignment

      Input and Output Variables assignment

      5. Drag and drop a Loop Element (Give the name Extract ID one by one) on the window and extract IDs from Collection variable and pass it to Text variable, as shown in the following screenshot

      Extract IDs from Collection variable

      Extract IDs from Collection variable

      6. Drag and Drop Assignment Element (Give the name Assign Data into SObject Variable) on the window and assign value of {!SingleID} and {!UserID} to Sobject variable {!Group_Record} (GroupMember Object Type) ,as shown in the following screenshot

      Add details into SObject Variable

      Add details into SObject Variable

      7. Drag-and-drop Assignment Element (Give the name All in one) on the window and assign value from Sobject variable {!Group_Record} to Sobject Collection variable {!All} (GroupMember Object Type) so at the end of the flow will use it inside the Fast Create to add user to Public Groups. Please refer to the following screenshot for more details

      Add SObject Variables into a SObject Collection

      Add SObject Variables into a SObject Collection

      8. Finally drag-and-drop Fast Create (Give the name Add user to Public Groups) on the window and map the field according to the below screenshot

      Add user to Public Groups

      Add user to Public Groups

      9. Finally our Flow will look like the following screenshot

      Add user to Public Groups

      10. Save the flow with name Add User to multiple Group and close the canvas.

      Call a Flow from a Custom link 

      We can call a Flow from custom button, link, sub-flow, Visualforce page , Apex start() or using Process builder. Here we will use custom link on User object to call our flow. To do that follow below instruction

      1) Click on Setup | Build | Customize | Users | Custom Links
      2) Click on New Button or Link button and construct a custom URL, as shown in the following screenshot

      Custom Link

      Custom Link

      3) Add custom link into the User Page Layouts.

      It’s time to test this feature

      To test this flow, follow the below instructions

      1) Create a New user, I have created a user with name “Demo user”
      2) Then click on custom link “Add user to multiple Groups“, available on the user detail page
      3) It will open the flow for you. Select few public groups and click on the Next button, as shown in the following screenshot

      Selected Public Groups

      Selected Public Groups

      4) Navigate to the Group related list available on detail page and you can see user is added to all of the selected groups.

      Final Output

      Final Output

      Note :- I will suggest you to Implement this first on your developer org test it and then move it to Production.

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

      Posted in Salesforce Flow, User Management | 12 Comments | Tagged Add user to multiple Groups, Add user to multiple Public Group, Add User to multiple Public Groups, Add User to multiple queue, Add User to multiple Queues, Advanced flow, Assignment Element, Cloud Flow Designer Workbook, dynamic choice, Dynamic choice Multi-Select check-box field, Fast Create, flow, Flow Designer, group, GroupMember, Loop Element, Mismatching Versions, MSP to Collection Variable, Multi-Select Checkbox, Package flow in Slaesforce, Package Visual flow, Parse MSP to a collection Flow, Parse MSP to collection variable flow, Parsing Multi-select checkboxin Flow, Parsing Multi-select picklist in Flow, Public group, Public Groups, Subflow example, Subflow example Salesforce, Visual flow, Visual flow Rockstar, Visual Workflow Flow Cloud Flow Designer
    • Clone Public group or Queue with members

      Posted at 4:07 PM by Rakesh Gupta, on July 19, 2014

      After Clone Chatter group with members article, I got lot’s of Emails/Messages from people wants to know about how they can clone “Public Group or Queue. Before going ahead I want to say big thanks to Mr. Mark Ross to feature my #Sp14FlowHackathon idea in his article.  In this article, I will discuss how a Salesforce administrator can build an application using Flow to Clone Public Group or Queue.

      Business Use Case

      As a Salesforce admin many times you got the requirement to create one Public Group similar to existing group X (In our case we will say Public Group Sales Managers) and add few more users into it.

      Solution for the above business requirement

      Again this is the power of Visual Workflow, we will create an app without using a single line of code. Before proceeding ahead you have to understand Group and GroupMember objects in Salesforce.

      1. Group: – This Group object represents Queue and Public Group both. Groups are sets of users.  A Group can contain individual users, other groups, the users in a particular role. By using Type field you can distinguish between Queue and Public Group. For Public Group (Use Type = Regular) and for Queue (Use Type = Queue).
      2. GroupMember: – Represents a User or Group that is a member of a public group.

      Note: – In this article, I will only discuss clone Public group. In the similar fashion, ou can develop a flow for the Queue.

      To develop this application follow the below instructions

      1) Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
      2) Click on New Flow, it will open flow canvas for you
      3) Drag and drop a Screen ( Give the name Clone Public Group) on the window, add Three fields with below details

      Name Data Type Required
      Old Group ID Textbox Yes
      Textbox Textbox Yes
      Grant Access Using Hierarchies Checkbox No

      It will look like the below screenshot

      To Get User Input

      To Get User Input

      4) Drag and drop a Record Create ( Give the name Create Public Group) onto the window to create a new Public group and map the fields according to below details

      • Select Object Group
      • Name=  {!New_Group_Name}  [ This is nothing but Screen Input]
      • Type=Regular
      • DoesIncludeBosses={!Grant_Access_Using_Hierarchies} [ This is nothing but Screen Input], Save Id of record into any variable in our case it’s {!NewGroupId}. You can take help from the following screenshot
      Create new Public group

      Create new Public group

      Note: – For Queue set Type = Queue and remove the field DoesIncludeBosses from Record Create element and add another field as per your choice.

      5) The next task is to get the list of the member id from the old Public Group for cloning. To do this Drag and drop a Fast  Lookup( Give the name Extract all members from old group) and map the field according to the below screenshot and save the field UserOrGroupId value into Sobject Collection in our case it’s {!OldMembersID}

      To get the list of members from selected group

      To get the list of members from selected group

      6) Now our next task is adding members to the new group. For this we will use Loop, Assignment and Fast Create. To do this Drag and drop a Loop ( Give the name Extract memebrs one by one) and loop through Sobject Collection {!OldMembersID} and save current value in New Sobject Varibale {!OneByone}  as shown in the following screenshot

      Loop through Sobject Collection

      Loop through Sobject Collection

      7) Now Drag and drop an Assignment Logic ( Give the name Assign New Group ID) and assign {!NewGroupId} to Sobject Varibale {!OneByone.GroupId}, as shown in the below screenshot

      Assign New Group ID

      Assign New Group ID

      8) Drag and Drop Assignment Logic (Give the name Mass Add) on the window and assign the value from Sobject variable {!OneByone} to Sobject Collection variable {!AllinOne} so at the end of for loop (To avoid SOQL limit), it will add all members from old Public group to new Public Group. Take the help from the below screenshot

      All in One

      All in One

      9) Finally, drag and Drop Fast Create (Give the name Add Members In New Group) on the window and map the field according to the below screenshot

      Add Members into New Public group

      Add Members into New Public group

      Finally our Flow will look like the following screenshot

      Clone Public group or Queue with members

      10) Save the flow with name Clone Public Group or Queue and close the canvas.

      Add Visual workflow into the home page component

      We can call Flow from a custom button, link, sub-flow, Visualforce page, Apex start() or using Flow Trigger workflow action. Here we will call our flow from the homepage component. To do that follow below instruction

      1) Create custom link from Name | Setup | App Setup | Customize | Home | Custom link

      Custom link

      Custom link

      2) Add custom link in the Home page component
      3) Add Home page component into the Home page layout

      It’s time to test this feature

      1) In this demo, I will Clone Public Group “Sales Managers“, as a first step copy the ID of Public Group “Sales Managers”
      2) To open this app click on “Clone Public Group” link available on the homepage, and fill the details you can take help from below screenshot

      Clone Public Group with members

      Clone Public Group with members

      3) Click on Next button and you are done. Below is the proof of concept

      New Public Group with members

      New Public Group with members

      I will suggest you Implement this first on your developer org test it and then move it to Production.

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

      Posted in Salesforce Flow | 0 Comments | Tagged ADM 201, adm 201 certification, adm 201 salesforce, admin release exam, Advance flow, Assignment, Assignment in flow, call Flow from custom link, Call flow through apex, Call flow through button, Call flow through link, Chatter, Clone Group in Salesforce, Clone Public Group, Clone Public Group in Salesforce, Clone Public group or Queue with members, Clone Public Group with member, Clone Public Group with members, Clone Queue, Clone Queue in Salesforce, Clone Queue with member, Clone Queue with members, Cloning of public group, Cloning of Public Group with members, Cloning of queue, Cloning of queue with members, Cloning through Flow, Cloning through Visual workflow, Con 201, Create record through flow, Custom link, dev 401, DEV401, DoesIncludeBosses, Fast Create, Fast lookup, flow, Flow examples, Flow exmple, group, GroupMember, Home page component, invoke flow, loop, Loop in flow, New Flow, Public group, Queue, Record Create, Record Create in flow, Record Lookup, Record lookup in flow, salesforce, Screen, Sobject Collection, Sobject Varibale, Visual workflow, Visual workFlow examples, Visual Workflow Implementation Guide
    ← Older posts
    • 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 59 (Clone a Chatter Group with Members)
      • New Research: Salesforce Delivery Teams Excel in Speed but at the Expense of Quality
      • Improve Your Data Collection Strategy with Web Forms
      • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
      • Advancing Business Operations with Salesforce and QuickBooks
    • 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 43 (Dynamic Approval Routing in Salesforce)
    • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
    • Getting Started with Salesforce Flow – Part 59 (Clone a Chatter Group with Members)
    • Getting Started with Salesforce Flow – Part 11 (Count Number of records in a Record Collection Variable)
    • Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
    • Getting Started with Salesforce Flow – Part 1 (Understand, Create & Use Variables in Flow!)
    • Salesforce Spring’21 Release Quick Summary
    • Getting Started with Process Builder - Part 1 (Automatically Create a record)
  • Social Media

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