How to Use Microsoft Flow for an Inbound Lead

Every business has some repetitive tasks that must performed on a regular basis. These tasks are often time consuming and mundane. Traditional task automation requires the ability to code, a skillset not shared by most employees. Microsoft wanted to make task automation available to the masses and Microsoft Flow was designed with that idea in mind.

Microsoft Flow is a cloud-based technology that runs on Azure. It allows for visual task automation with little to no coding involved. At most, a few lines for formulas may be required to give guidance to a flow.

Flows exist in the Microsoft ecosystem and have a multitude of connections to Microsoft and third-party technologies that businesses use every day. A flow is designed so that it listens to the services you specify, waiting for specific events to occur. Once an event is triggered, a pre-defined series of actions will be processed. When a flow is created, it will automate a business process for as long as it remains activate. Also, flows can be exported and saved as templates so that other users can leverage them.

The amount of time that a flow can save a company can be massive in some cases. Meticulous and cumbersome tasks can be automated entirely or turned into computer assisted processes. Not only does this save time, it frees employees to work on more meaningful tasks.

To illustrate this point, I will design a flow that automates assigning an inbound lead and responding to that lead on behalf of a salesperson.

Creating the Flow

The default behavior is to monitor the inbox of the designated account, which works fine in this case.

Microsoft Flow Step 1

Adding Controls

Our next action is a control action, specifically the Switch control.

Switch Image Microsoft Flow

Control actions allow the flow to behave differently under different circumstances – to control the flow. The switch control allows us to select a specific control statement based on the some result. We want to use our switch to randomly select a salesperson and send an email on their behalf. Mine looks something like this when filled out:

The pink square in the On field is the expression we want to use for controlling the switch.

Using Expressions

Let’s look at the expressions. Expressions perform some action based on the information provided to them and return some value. We need to select a random salesperson. The way we will do this is with the rand(int, int) expression in the switch control.

Random Expressions Microsoft Flow

Rand() returns a random number including the left parameter and excluding the right parameter, so 0 or 1 in this case. If the number is 0, I want to send an email on behalf of John Doe, an example salesperson. Alternatively, Jane Doe will be selected if the random expression returns a 1.

Note that for demonstrative purposes, this has been simplified. You could import a list of sales staff, get the count of staff and use that number to populate the Rand() expression. The flow would automatically update to account for new sales staff members once they were added to the list.

Send an Email for Each Case

Now that we have a mechanism to select a random salesperson, let’s complete the Flow by setting up an action for each outcome.

Response Automation for Microsoft Flow

These two cases are identical except for the name and email of the salesperson responding. We will look at the case where the random expression returned a zero. The outcome of the case is to send an email using the Outlook – Send Email action.

Send an Email Microsoft Flow

We need to fill out the fields of this action like this:

Send an Email Microsoft Flow

To is used to determine who the message will be sent to, in this case, we choose to send it back to whomever it was from. The Subject is RE: followed by the received email’s subject so that the sender knows this is a response email. The Body of the message is composed based on which salesperson is responding to the lead.

Now we can test this flow to ensure that it produces the results we expect. I sent a few emails to the inbox specified earlier and got responses back randomly, as we would expect.

Automated Email Microsoft Flow

Why do we Care?

Now that the flow is operational, your marketing team no longer needs to perform this tedious task. The team can spend more time searching for leads and trying to make sales. The scope of tasks that a flow may automate is quite large, so it is wise to use many flows at a time, each handling a set of menial tasks on behalf of your teams. There is a lot of flexibility in the way a flow may handle a task.

As you become familiar with Flows, you can offload menial, repetitive tasks and focus on the challenging, critical tasks that humans do best.