Overview
The article details how to use the Salesforce Import feature to automate challenge targeting in AdvocateHub based on date ranges. It provides a step-by-step guide on creating formula fields in Salesforce to calculate date ranges, mapping these to Custom Profile Fields in AdvocateHub, and setting up challenges that automatically unlock for advocates based on these date ranges. This process enhances the personalization of challenges and reduces administrative workload.
Information
How does it work?
We will take advantage of existing functionality that is a part of our Salesforce integration for this flow. Using the Automatic Customer Data Import , we can map fields on a Contact or Account object in Salesforce to a Custom Profile Field in your AdvocateHub. We can then use the value of the Custom Profile Field to automatically unlock challenges for your Advocates through our targeting functionality.
In Salesforce, we are going to manipulate a date field you have set up by creating a new formula field that will display a range of the number of days since the date specified in the date field you are targeting.
For example, if you have a Salesforce date field on the Account or Contact called 'Launch Date' and the value of this field is January 1st 2019. We will use the formula field to count how many days in the past this date was compared to the present day and then to visualize this by a range of numbers. Working with this example, if the current date is January 20th the range could show a range of 1-20, as in, the date in the Launch Date field happened 1-20 days ago. We will discuss how to set this up in more detail below and display how flexible this can be.
The value of this field can then be mapped to the Advocate's profile in the form of a Custom Profile Field and this data can then be used in the targeting of Challenges so that the Advocate can have a challenge(s) unlocked automatically based on how long ago they launched.
Examples Of Flows This Could Be Used For
- Unlocking a congratulatory challenge for a customer who has launched recently
- Unlocking some post-launch challenges to help your customer out with tips and best practices
- Unlocking challenge to check-in on your customer at different points in their lifecycle
- Adding Advocates to new groups at a certain point in their lifecycle
Steps Required
Salesforce
Let's start by creating our new 'date range' field on our Contact or Account object where our target Date Field lives. For these steps, I will be working with a field called "Launch Date" on the Account object.
1. In Salesforce, navigate to Setup > Customize > Accounts > Fields and click the "New" button under the Account Custom Fields & Relationships section of the page
2. Choose "Formula" as the Field Type
3. On the next page, label the field however you like and choose "Text" as the Formula Return Type . I am going to name it "Launch Date Range" in this example.
4. Entering the formula below would populate our new "Launch Date Range" field with 0-19 if the date was in the last 20 days and "None" if the date did not fall in this range:
IF( (TODAY() - Launch_Date__c > 0 && TODAY() - Launch_Date__c < 20), "1-19", "None")
But what if we want rolling ranges? The formula below builds on the one above and will now populate our field with 0-19 if the Launch Date is within 20 days, 20-39 between 20 and 40 days, 40-59 between 40 and 60 days and "None" if the date falls outside these ranges.
IF( (TODAY() - Launch_Date__c > 19 && TODAY() - Launch_Date__c < 40), "20-39",
IF( (TODAY() - Launch_Date__c > 39 && TODAY() - Launch_Date__c < 60), "40-59",
"None")))
You should be able to see the pattern now. If the field you were working with was called "Renewal Date" then you would replace any occurrence of "Launch_Date__c" in this formula with "Renewal_Date__c".
The ranges are completely customizable too! You can add as many 'IF' statements as Salesforce will allow and you can change the ranges easily. For example, if you wanted to do 50-day windows instead of 20 like in this example, just do this:
IF( (TODAY() - Launch_Date__c > 49 && TODAY() - Launch_Date__c < 100), "50-99",
IF( (TODAY() - Launch_Date__c > 99 && TODAY() - Launch_Date__c < 150), "100-149",
"None")))
AdvocateHub
Now that we are all set on the Salesforce side we can jump back into your AdvocateHub to complete the flow setup!
1. Create a Custom Profile Field in your hub and call it "Launch Date Range" - sticking with this example but you can name it whatever makes the most sense to you! You can quickly do this by following the instructions in the below article:
2. Now we need to map the Salesforce date range field to our newly created Custom Profile Field! Go to your Salesforce integration in your AdvocateHub and under the Settings tab, expand the Automatic Customer Data Import section.
3. Click Add Mapping .
4. On the left-hand side, choose the 'Launch Date Range' field we created in Step 1 and on the right-hand side, choose the 'Launch Date Range' field you created in Salesforce. It should look like the below:
5. Next time the import runs, which is once per day (usually every morning at around 3am ET), the value of the Launch Date Range field in Salesforce will now be populated on the Advocates profile like the below:
6. Finally, if set the targeting of your challenge like the below, it will be automatically unlocked for Advocates who have the given range as their Launch Date Range:
FAQ
How does the Salesforce Import feature help in targeting challenges in AdvocateHub?
The Salesforce Import feature allows for the automatic synchronization of date ranges from Salesforce to AdvocateHub, enabling challenges to be targeted and unlocked for advocates based on specific time intervals since a given date, such as their 'Launch Date'.
What are the steps to create a formula field in Salesforce for date ranges?
To create a formula field in Salesforce, go to Setup, customize the desired object fields, create a new formula field, and use an IF statement to define the date range based on the difference between the current date and the target date field.
How often does the import run to update the Advocate's profile with the "Launch Date Range" value from Salesforce?
The import runs daily, typically around 3am ET, to update the Advocate's profile with the latest "Launch Date Range" value from Salesforce.
Can the date range values in the Salesforce formula be adjusted for different time windows?
Yes, the date range values in the Salesforce formula can be customized by modifying the IF statements to fit different time windows as needed for the challenge targeting.
What is the benefit of using date ranges for challenge targeting in AdvocateHub?
Using date ranges for challenge targeting allows for a more personalized and dynamic experience for advocates, as challenges can be automatically presented at relevant stages of their lifecycle, reducing manual effort for administrators.