Use External Actions to Create Custom Salesforce Tasks

Use External Actions to Create Custom Salesforce Tasks

min. reading

Salesforce tasks are one of the unsung heroes of Account Engagement. You can use Salesforce tasks to let the sales team know there’s work to be done, and using tasks can eliminate one of the common arguments for creating duplicate leads.

Yet, many are unhappy with the rigid options for creating tasks through Account Engagement. That leads us to our solution. We can make tasks even better, perfectly better in fact! We can make Salesforce tasks that are set up exactly how we want through Account Engagement using an External Action.

External Actions are a way to make things happen outside Account Engagement via Salesforce CRM Flow and APEX code.  We can create an External Action that creates a task with what we want in it and our merge fields in the body of the task comment so we can capture exactly what was on a form fill.

Process Overview: Creating custom Salesforce tasks with Account Engagement External Actions

Normally we would add a completion action to a form called “Create Salesforce Task,” which prompts us for a few rigid text fields that don’t support merge fields. 


Now we can add an ‘External Action’ for creating a task that has as few or as many fields as we want and allows us to add merge fields. 

Building this new Create Salesforce Task external action

There are a few steps we need to follow to build this. We start in the CRM and work backwards, toward Account Engagement.

Here’s the order you’ll complete the steps:

  1. Create a flow.
  2. Create an External Activity.
  3. Create the completion action.

Creating the Flow

First, we want to create an Autolaunched Flow.

Create variables

Next, let’s create some variables. The RecordID is the only required variable. (We need to attach the task to something). The rest of the variables are optional, but having them will give us more flexibility when we create the completion action.  All variables should have the ‘Available for Input’ checkbox checked. 

VariableData TypeRequired
RecordIDTextYES
Product_InterestTextNO
Task_InstructionsTextNO
Form_CommentsTextNO
Task_SubjectTextNO

Build the Flow

After creating the variables, we can get build the Flow. Start with the Decision Element to create a different path for Leads vs. Contacts. We’ll need to look up the record owner in the CRM, as Account Engagement doesn’t give us access to that as a merge field. To do this, we need to know whether to look up a Lead or Contact record. Use the table below to set up your lead path filter.

FieldOperatorValue
RecordIDStarts withOOQ

Update the label for the default path to “Contact”.

Add a ‘Get Records’ element

For each path, we will need to add a ‘Get Records’ element.  Select the correct object and then set the following filter:

FieldOperatorValue
IDEQUALSRecord ID

Create task details

Next, let’s create the task details. Start by creating another variable using the details below. Do not check the “available for input” box for this variable. 

Variable NameData TypeObject
NewTaskRecordRecordTask

Add an Assignment element

Then, add an Assignment element for each path to fill in the details. The Assigned To ID for the new task is the record owner from the object we looked up. Lead owner ID if it was a lead, Contact OwnerID if it was a contact.

Optional Step: Description formula

For the description, we can use a formula to put together the description that we want using a combination of our other variables.  To do this, create another variable with the type “formula”. Name it “FormattedText” and input this as the formula: “{!Task_Instructions}BR(){!Form_Comments}”

This will update the description field on the task to display the information inputted from Task Instructions and Form Comments. You can input a formula to include the variable values that are important to you. See another example in the screenshot below.

Create task record

Our last step in the flow will be to create the task record. Use the “Create record” element and add the variable “NewTaskRecord” under the “record” drop-down. Leave the other settings as is.

Flow is complete

When you are complete, your flow should look like this:

Your flow is complete. You can debug using an existing record. You will need to activate the flow before moving on to the next step.  

Marketing Extensions External Action

Next we want to create the External Action. Be careful with these,  we can’t currently delete any we make by mistake. If you have access to an Account Engagement Sandbox, this could be a good time to use it when building your first External Action.

Create a new Extension

In Marketing Setup> Marketing App Extensions, we will want to create a new Extension.  Name it “Create Task” and select the box “Active in Automation”.  

Create a new Action Type

Once it’s created, go to the Related Tab, and create a new “Action Type”.

Name it “Create Task” and Search for the flow we just created under “Invocable Action”. The flow must be activated.  Check the box for “active in automations” . 

The Action Type will write an Action Schema for us. We can simply click save, and we are done.

Optional Step: Adjust default details

We can also adjust the default details, providing Account Engagement default merge fields, and reordering the fields in the ‘view’ section, and even making fields required, such as our RecordID field. These adjustments can make our new tool easier to use! In the screenshot below, we’ve added in the merge field for RecordID so that we do not have to have our end users do this in Account Engagement.

Select business unit

Under the related tab, select “New” under Business Unit Assignments. Search for your business unit name and select it.  If you are unsure of your business unit name, go to Marketing Setup > Business UnitSetup.

Completion Action

Now we can use our shiny new Task!

Finalize with completion action option

When our Marketing App Extensions have all the bits ‘Active’ and we have assigned our business unit, we will get a new Completion Action option on forms and Engagement Studio Programs.

Fill in all the fields

This is where we can fill in all the fields we created as flow variables. We can use Account Engagement merge fields to fill them in, or just start typing text. Or a bit of both!

If you look at the ‘Task_Instructions’ in this example, you can see we can fill in text with a bunch of merge fields. Those merge fields are other completion actions on a form.

Start Creating Custom Tasks!

We used to be able to create a task and only have a generic “Follow up with this Contact” in the description. With custom tasks, the descriptions can now be populated dynamically with the exact information that prospects input on a form.  

Tasks can hold custom information like support questions or product interests, which can help streamline the next steps for the users receiving the task. So if your sales team is getting the tasks sent to them, then they can check the task to understand the best route to take.

Need help understanding how external actions and Salesforce tasks fit into your overall business strategy? Reach out to the team at Sercante to start a conversation.

Thank you to Mike Creuzer for contributing his expertise to write this post!

Subscribe to The Spot

This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is for validation purposes and should be left unchanged.

Upcoming Salesforce Events

Salesforce Training Courses

Categories

Top 5 Recent Posts

  • Michelle Cornely is a Marketing Automation Strategist at Sercante. She earned her BBA at Loyola University Maryland, and currently has 3 Salesforce certifications, including Pardot Consultant and Salesforce Administrator. Prior to joining Sercante, Michelle led demand generation teams for a few different tech companies and has experience using both Pardot and Marketo. When she's not working, she can be found chasing after her two very cute toddlers. Michelle loves helping companies achieve their goals and finds joy in tackling hard-to-solve problems.

Leave Your Comment

Related Articles

Bot Single Post