Advocate Engagement Flow - Using Date Ranges To Unlock Challenges


Using the information in this article will allow you to create a variety of different flows in your AdvocateHub. These flows will give you the ability to automatically serve up challenges for Advocates during specific points in their lifecycle based on date fields on the Contact or Account objects in Salesforce. This will take a huge amount of the burden off of an Administrator.

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 match category in your AdvocateHub. We can then use the value of the match category 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 which 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 match category 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


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 > 0 && TODAY() - Launch_Date__c < 20), "1-19",
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",

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 > 0 && TODAY() - Launch_Date__c < 50), "1-49",
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",
If you check your Account object you should see something like this now:


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 Match Category 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:

Match Categories

2. Now we need to map the Salesforce date range field to our newly created match category! 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:

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us