CHALLENGE:
You want to use a date or dateTime field in an Opportunity/Order/Task/Appointment to run a field timer in Infusionsoft Campaign Builder. These fields are not available as merge fields in Campaign Builder.
SOLUTION:
This tutorial and accompanying video gives you the step-by-step to use the Pocket Developer Any Date, Any Format, Anywhere Building Block to programmatically copy the date from the Opportunity/Order/Task/Appointment to a field in the Contact record so it can be used in the Field Timer. You can put the date in an unused Date field, such as Anniversary, or a custom field made specifically for the purpose of “stashing dates” copied from Opportunities, Orders, Tasks and Appointments.
STEP-BY-STEP
1. In Campaign Builder, where you want the Field Timer to run, create the following sequence:
- an HTTP POST snippet
- a field timer
- whatever action or actions you want to occur when the field timer is triggered (for example, sending an email)
- another HTTP POST snippet
2. Open the first HTTP POST snippet. Configure as follows:
- URL: http://yoursite.com/scripts/PocketDeveloper/Blocks/AnyDate/anydate.php (change path as necessary)
- contactId => ~Contact.Id~ (no need to change this)
- date => the Opportunity/Order/Task/Appointment field you want to use in the Field Timer (see Notes below)
- format => YmdTH:i:s (this is the PHP format notation for all Infusionsoft date or DateTime fields)
- saveTo => the Date field in the Contact Record (without tildes) where you will temporarily store the date while the Field Timer is running
3. Open the Field Timer. Configure as follows:
- Change the Contact Field to the Date field where you are stashing the Opportunity/Order/Task/Appointment date (e.g. Anniversary)
- Change the dropdown below it from Next Occurrence to Use Year From Field
- Configure Wait and Time to taste
4. Configure emails triggered by field timer, etc
* Remember you cannot put a Delay Timer in line with a Field Timer. If you plan to send a series of emails, after the Field Timer, put the emails in their own sequence with HTTP POST in Step 5 at the end.
5. Open the second HTTP POST snippet. Configure as follows:
- URL: http://yoursite.com/scripts/PocketDeveloper/Blocks/AnyDate/anydate.php (change path as necessary)
- contactId => ~Contact.Id~ (no need to change this)
- date => 09/09/2099
- format => YmdTH:i:s (this is the PHP format notation for all Infusionsoft date or DateTime fields)
- saveTo => the same Date field in the Contact Record (without tildes) as before
* Once you put a date in a date field, you cannot make it blank again. We set ours to 09/09/2099 when finished just so nothing runs accidentally and we know that field is available for stashing.
HOW TO SELECT A FIELD IN A SPECIFIC OPPORTUNITY/ORDER/INVOICE/TASK/APPOINTMENT/REFERRAL ETC
These record types have not been available in Infusionsoft’s Campaign Builder because they are a one-to-many relationship to the Contact Record. This means each contact can and probably does have multiple opportunities, invoices, orders, etc. So the challenge is how to specify which one you want.
We have create an Advanced Merge Field Notation, which allows you to specify a field in a specific one to many record for use in Pocket Developer Building Blocks:
- In the Infusionsoft database, an Opportunity is referred to as a Lead. Our notation will take either Lead or Opportunity
- Similarly, the database name for an order is Job. Our notation will take either Order or Job
- You must always precede a custom field with a “_”. Stock Infusionsoft fields have no “_”
- The merge filed notation used in the example (Opportunity._TestDateTime) assumes there is only one Opportunity. If there was more than one, it would pull TestDateTime from the most recent one
- In cases where you know there are multiple records and you want to pull from one of them, Advanced Merge Field Notation allows you to use filters to select a specific record
- The syntax for our notation is Table.Field.[FilterBy(…)][.OrderBy(…)][.Qualifier1[.QualifierN[…]]]. Parameters in brackets are optional.
- A simple example would be Opportunity.NextActionDate.FilterBy(StageID:59). This would pull NextActionDate from the most recent Opportunity with Stage ID = 59. Opportunity.NextActionDate.FilterBy(StageID:59).Oldest would pull NextActionDate from the first or oldest Opportunity with Stage ID = 59
- An example using an Appointment would be ContactAction.ActionDate.FilterBy(IsAppointment:1,ActionType:”Meeting”)
You can read more about Any Date, Any Format, Anywhere and see more examples of its usage in the QuickStart Guide.
You can read more about Advanced Merge Field Notation and see more examples of its usage in the Learning Center.
FREQUENTLY ASKED QUESTIONS:
Q. Where do I find the table and field names for Advanced Merge Field Notation?
A. You can find the names of Infusionsoft tables and fields in the Infusionsoft Developer Resource Section under Table Documentation. You can find the names of your custom fields by going to Infusionsoft Admin Settings -> Add Custom Field -> Record Type -> Show Database Name
Q. Why isn’t the field I want to use showing up in the Field Timer dropdown?
A. There could be two reasons: It is not a Contact field or it is not a Date field. (Remember, DateTime fields do not work in Field Timer)
RELATED ARTICLES AND POSTS
[loopbuddy query_id=’12’ layout_id=’12’]