What It Does
Prefetch is a feature built into our Advanced Merge Field Notation. Advanced Merge Field Notation is the way you tell Pocket Developer what field you want to work with. Prefetch allows you to burrow deep down into the tables to use a piece of data that is not easily retrieved using just the contact ID.
For those of you who are programmers, Prefetch is Pocket Developer’s version of a join. For those of you who aren’t, ignore that. Doesn’t matter.
Prefetch also allows you to save multiple pieces of data, coming from different places, into a single merge field. See the examples and demo video that follow to get a better idea of the power of prefetch.
Where I Can I Use It?
Prefetch is available anywhere Advanced Merge Field Notation is. All “Core” Pocket Developer plug-ins have Advanced Merge Field Notation and therefore can use Prefetch. Core plug-ins are the yellow ones in the Pocket Developer Store.
Core plug-ins include (at last count):
- Any Date, Any Format, Anywhere
- Any Opportunity To Any Stage
- Any Text Anywhere
- Contact’s Company
- Email Anyone Anytime
- Field Math
- Tags On The Fly
- Universal Delay Timer
Check the Pocket Developer Plug-In Store for the most updated list and to see all 30+ Pocket Developer plug-ins.
How To Use It
To use Prefetch, include it as a parameter in an HTTP POST snippet that calls a core Pocket Developer plug-in.
Prefetch Notation
prefetch[label]
- Each prefetch “parameter” will act as an
independent lookup and store the result of said lookup in the specified label for the prefetch - Prefetch label can be anything. You can label a piece of data “purple” if you want
- You can do more than one prefetch in a single HTTP POST snippet
- Prefetch allows for cascading usage of lookup results. That is to say, the result of prefetch action #1 can be used within the lookup details of prefetch #2, #3, as well as the basic parameters of the plug-in.
Prefetch Example
To demonstrate some of the principles, consider the following example. Let’s assume that we would
like to get the quantity of a line item within an order, and then include it in the textToSave
parameter of the Any Text, Anywhere plug-in.
To achieve this result, we would define the following key/value pairs within an HTTP POST action within campaign builder:
contactId = ~Contact.Id~
prefetch[order_id] = Order.Id.Newest
prefetch[item_id] = OrderItem.Id.FilterBy(OrderId:{order_id}, ItemName:"Plan 1")
prefetch[item_qty] = OrderItem({item_id}).Qty
prefetch[notes] = Contact.ContactNotes
textToSave = User has ordered {item_qty} of item #{item_id} in order #{order_id}nn{notes}
saveTo = Contact.ContactNotes
This specific example would have the effect of prepending the “User has ordered …” line to
the contact’s ContactNote field.
prefetch[order_id]
gets the ID of the newest order and stores it with a label of order_idprefetch[item_id]
uses the previously stored order_id to get the ID of the item on that order called Plan 1 and stores it with a label of item_idprefetch[item_qty]
uses the previously stored item_id to get the quantity ordered of that item and stores it with a label of item_qtyprefetch[notes]
stores the contents of the big Contact Notes tab in the contact recordtextToSave
prepends the string “User has ordered {item_qty} of item #{item_id} in order #{order_id}”. The codes “/n” create line breaks. Then the previous contents of the field are appended using {notes}.
Demo Video
Frequently Asked Questions
Q. Where do I find all of the table and field names?
A.Infusionsoft has a complete reference for all the tables and fields you can use with Pocket Developer’s Advanced Merge Field Notation. Although the table names, in particular, may not be immediately obvious, the descriptions will help you find what information is stored in each table.