Tag: automation

Using Flows to Update a Lead Status

Using Flows to Update a Lead Status

In our last tutorial, we learn how to start a flow, and create a custom button on the lead for easy access. Today we are going to build on what we’ve’ started and expand our flow process.

Flows are a multi faceted tool that you can utilize in Salesforce to achieve many different goals. The flow builder is capable of many things, whether it be directly altering records or performing actions based on subsequent actions.

Today we are going to start with a very basic task using flows, that can come in handy in many different situations. We are going to walk through updating a lead to a certain status based on how you go through a flow.

First, navigate to “Flows” which can be found under “Workflow & Approvals” in Setup. What we want to do now is start a new flow, so that we may start with a blank slate.

To the left, navigate to the menu to the left, and under Pallette, you will be able to scroll through the options, until you eventually see “Record Update”, among the various other tools we have at our disposal.

But before we actually implement the use of a record update, we need to build a flow first that we can build our record update logic off of.

To keep it simple, we will make a small questionnaire that will be used by your company’s intakers to  essentially determine whether a leader is qualified or disqualified.

Let’s begin by adding a “Screen” which is the main building block that allows you to interact with flows. You can find “Screen” under “User Interface” in your Pallette.

For our first screen, let’s just create a generic welcome screen to let our intakers know what flow they have accessed and give them a basic message before continuing through the process. We can achieve this by adding a “Display Text” that essentially make a custom text that you can modify and style, but cannot be interacted with.

I’ve gone ahead and added a basic message that will segway our intakers into the flow.

Now it’s time to add our second screen. Drag a 2nd screen near your welcome screen. Remember we are essentially building a flow chart, so it’s important to keep it as organized as possible.

Let’s go ahead and call this screen “Intake Step 1”. It’s important to keep your names as short and detailed as you can make them, as your flows get bigger, naming organization is paramount to keeping your sanity so you don’t have to sift through your flow aimlessly when trying to track down a specific item.

So the purpose of this flow is to help our intakers determine whether volunteers qualify to join the space cadet program and defend earth against invaders. In order to do that we need to be able to interact with a few questions to determine whether they are qualified to do so or not.

Let’s add a radio button field onto our screen, we are going to utilize this to ask a yes or no question. Let’s go ahead and label our field with our first question, “Are You Capable Of Using A Blaster Rifle?”. We want to make sure our volunteers are capable of using futuristic weaponry.

Now that we have the field, we need to add some answers, we do this by using “Choice Fields”. Since we haven’t created a bank yet in the dropdown, click “CREATE NEW”, and choose “Choice”.

Make sure your label is “Yes” and for the sake of this exercise our Unique Name and Stored Value will be the same. Repeat the process to also make a “No” option.

Now you can see on the right under our fields that our first question now has a yes or no option.

Let’s go ahead and ask our second question. Let’s ask if our volunteer knows how to fly a spaceship. Remember, what you use as your label is what you will see in the actual flow.

Now since we are asking another Yes or No question, let’s go ahead and make this another radio button. Now since we have already created a bank of “Yes” and “No” for our previous question, they are now stored in our bank and we can reuse these throughout the flow. Instead of clicking “CREATE NEW”, under the “CHOICES” dropdown, you will already see the yes and no we created earlier. Go ahead and recreate the two answer options like we did for the previous question.

Now that we have our first screen complete, we need to connect it to our welcome screen. Do so by dragging the small square on the welcome screen box and connect it to the qualifications screen box. This will now “connect” the screens with an arrow that shows in which way the flow is directed


Now before we add any logic to our completed screen, let’s think ahead to what we want it to interact with.

Let’s add not one, but two end screens,  since we have two outcomes. We will have a qualified end screen, and a disqualified end screen. I went ahead and called mine “Disqualified End” and “Qualified End”

Go ahead and drag 2 more screens into the flow, remember keep it visually organized.

Before we can determine what goes on our end screens, we need to first think about our flow process and what the qualification questions are meant to determine.

Let’s say our business process is to determine if a cadet is qualified is that they must be both proficient with a blaster rifle and an ace pilot. That would mean that BOTH questions must be answered yes for a cadet to be qualified. Any other combination wouldn’t make the cut and therefore, they would be disqualified.

So how do we implement this logic? First, we need to put in a place a mechanism that determines which end screen you end up on. We will use a decision to do this. A decision is a building block where you can use logic to determine which way you go through your flow and determine what actions are taken.

Let’s drag our decision in between our qualification screen and our end screens. We want to give our decision a descriptive name that relates to what it is interacting with. So let’s call it “Qualification Screen Decision”.

A decision can harbor multiple “Outcomes” which you can see on the left. You can use outcomes to have the decision prepare for when you have different combinations of answers that may lead to different actions. You are also supplied with a default outcome that triggers if none of your custom outcomes are true.

For this situation we will only need one outcome, and then we will leverage the default outcome. In order to be in line with our business process of requiring cadets to be good with a blaster and fly, both questions need to be answered “Yes”. Name your outcome something descriptively, such as “Cadet Is Qualified Outcome”. You will find the questions you made on the previous screen under Screen Choice Fields. Make sure both answer values are “Yes”.

Now since we only have one outcome, and are going to use the default outcome for anything other answer combination that isn’t Yes & Yes, let’s go ahead and rename it “Cadet Is Disqualified Outcome”.

So now that we have a functioning decision, we need to properly connect it within our flow. Drag the arrow from qualification screen to the decision, and then drag your decision to both end screens. When you have more than 1 if will give you a choice when you connect the points.

Now that we understand what each end screen is meant for, let’s go ahead and add some display text to each end screen. On our qualified screen let’s leave a message that let’s our intaker know the cadet has been qualified, and vice versa for our disqualified volunteers.

“Please inform and congratulate our volunteer and let them know that they will be joining our forces. “

“Please apologize and inform our volunteer that they didn’t quite make the cut. Please encourage them to return once they have hardened their skills.”

Now that all of our screens are completed, we have a functioning decision, it’s time to add in our record update logic, because that’s the whole point of this flow intake right? Now there are several ways to do this, we could utilize another decision, we could leverage the assignment tools, but for the sake of keeping this simple we will be adding a record update after each end screen.

Now in order for us to interact with the record we want to update, we need to add in a sObject Variable that allows us to interact with the lead object.

So let’s name it “LeadSObject”

We want to Update the “Lead” object

Now this is where the sObject comes in. We want to give our record update criteria on what lead we want to update. Now to update the specific record we launched from, we can use a filter, and to do this we will leverage the Id field.

Go ahead and drag a “Record Update” screen , and let’s name it “Lead Status Qualified Update”

Under field choose “Id”, and under value use “{!varLeadId}” which is our variable we created in our last tutorial to reference the record we launched from instead of a piece of static data. This associates our filter criteria to match the Id of the lead we launched the flow from, and will essentially update the original lead we are working with.

Under the actual field we want to update, choose “Status” and make the value say “Qualified”.

Be careful, if you do not have the value “Qualified” & “Disqualified” already in your picklist values for Lead Status, it will trigger an error during the flow. You ALWAYS need to have matching values in your flow/object if you are going to have them interact with each other in the flow.

Now you can repeat this process for our other end result. A quick way to do this is to copy and paste the Qualified record update and change the status value to “Disqualified”. It’s an easy way to save time.

Now to finish our flow nicely, let’s add a thank you screen regardless of decision. Add another display screen, with display text

“Thank you for taking the time to apply with us. We hope our survey was to your liking.”.

Make sure that both record updates point to our new thank you screen.

This is a very simple flow, that highlights the possibilities of what you can do. Stay tuned for more flow tutorials. Our academy is bound to grow and our business needs are bound to change!


Creating A Custom Flow Button

     In today’s tutorial we are going to focus on something simple, yet practical regarding flows. Currently salesforce doesn’t inherently give you an easy option to access your flows out of the box. So to get around this we can easily create a custom button to put right on our page layouts to launch flows directly.

     If you have never created a flow before, let’s do so now. You can search “flow” in your setup toolbar search, or you can navigate to Create – > Workflow & Approvals -> Flows. From here click “new flow”. You can name it whatever you like for the sake of this tutorial. For my org, the lead object is used to keep track of possible new recruits applying to the space cadet program, so I am going to create a button that takes my employees to our intake process.

     Once you start your new flow, navigate to the “Resources” pallette on your toolbar to the left, and double click “Variable” to open up a new variable creation screen. Now if you don’t know what a variable is used for, think of it as a bank of data that our flow can pull from to reference specific datas within our org so that we can build logic based on the data that is pulled.

     Via Salesforce You can use flow variables to store data that can be used throughout the flow and referenced as values for updating record fields.”

     Essentially, we want to create a variable that will reference the “LeadId” so that when we launch our button, it will bring us to the lead that we launch from. The referenced data is fluid and not static because we used a variable with our flow. Let’s go ahead and fill out our variable.

     It’s best practice to keep our default value as an empty string so if nothing is triggered, it stays blank. Next, we need a few screens to our flow so that we launch, we have something to look at to make sure our button is working. Under “Palette”, go ahead and drag a screen into your work area. Let’s just make this a basic welcome screen with a “Display Text” field with a simple introduction so we know what this flow is for. When you have filled out the screen, click “OK”.

     Let’s go ahead and add in a second screen, in my case, i’ll name it “Intake Step One”. We are going to leave the screen blank for later use. Go ahead and drag an arrow from the Welcome Screen to our second screen, making the Welcome Screen our starting flow point (which is signified by the green arrow on the box).

     In a new tab, go ahead and “Run” the flow, which can be found next to the save options. We want to keep this open to we can refer to the URL for our custom button.

     Now it’s time to create our button. Go To Leads -> Buttons, Links, and Actions under Setup, and create a new custom button. Your label is what your button will be named on your page layout. So for my button, I am naming it “Space Cadet Intake”. We want this to be a “Detail Page Button”, and the behavior is up to you, but I want mine to display in a new window. For content source we will be referring to our flow’s URL.

     So currently our flow URL is “https://na35.salesforce.com/flow/Space_Cadet_Intake/301410000000ycWAAQ”. This is currently static data, and we want to put in play the variable we created earlier so that our data referral can be fluid and be based on the LeadId. In order to do this we need to update the URL to use our variable. To do this we need to redirect our URL to our variable “varLeadId”, and have it reference a merge field of the “Lead Id”. To do this, take out the record identifier and replace it as such:


     Once we save, we now have a custom button that will bring us to the flow based on the LeadId. Let’s go ahead and add this to our page layout so we can use the button on our leads. Go to Leads -> Page Layout, and click “Edit” to the layout you wish to add to button to. For me I will be using the default Lead Layout.

     Navigate to “Buttons”, and drag your new custom button onto your page layout, and save. Now when you go to a lead, your custom button will be there and give you an easy way to launch your flow directly from the lead.

     Using buttons on your objects to navigate directly to flows will make it much easier for your users to access the tools they need to access, now at the click of a button thanks to you!

Distribution Engine – Salesforce Round Robin Lead & Case Assignment (Interview)

Lead and Case AssignmentHow can you share work among your teams, quickly, fairly, and intelligently? We met with Neil Crawford at Dreamforce 2014 to learn about Distribution Engine.

Distribution Engine is a powerful and easily configurable rules based engine that ensures your Leads and Cases (or any standard or custom objects) are distributed to team members in an intelligent and timely manner. Improve Sales rep and service agent productivity.

Implisit – Salesforce Email Integration and Automatic Data Entry Solution (Interview)

Implisit Product OverviewThe end of CRM data entry has a nice ring to it. We met with Gilad Raichshtain, the founder and CEO of Implisit, this year at Dreamforce 2014.

Implisit is a Salesforce AppExchange product that updates your prospect and customer communications to the appropriate CRM record, letting you manage your pipeline more effectively while saving you and your team valuable time on tedious tasks.