Using Lookup Data
The Lookup Data function lets you ‘pull’ data from an alternate form or table into an Autoresponder, Standard Email Notification or Dynamic PDF file. It’s particularly useful when integrated with SubForm functionality, or when you’re using multiple forms to collect data related to a single entry. When used with a SubForm, Lookup Data lets you create ‘Repeating Regions’ to output multiple elements from a ‘child’ form inside a loop.
Lookup Data Limitations
You can configure 2 lookup data source per PDF or email. To increase capacity, contact our support team about expanded capacity Plus Plans.On This Page
- Enabling Lookup Data
- Defining Lookup DataSources
- Using Alternate DataSource Wildcards
- Creating Repeating Regions
- Lookup Data and Conditional Content
- Showing One Row per Value (Summary Tables)
- Caveats and Limitations
Enabling Lookup Data
When defining an Autoresponder, Standard Email Notification or Dynamic PDF file, select the Include Alternate Lookup Data checkbox to enable Lookup Data.
Defining Lookup DataSources
When you enable Lookup Data, a Lookup DataSource page is added to the Wizard. Use this page to add one or more alternate Data Sources as described below.
To add an alternate Data Source:
-
On the Lookup DataSource page, click Add Lookup DataSource.
-
The Data Source Configuration Settings screen displays.
-
-
Enter a meaningful name for the Data Source in the DataSource Lookup Name text box.
- Choose the alternate form you want to use as a Data Source from the Data Source/Form dropdown.
-
The Data Source/Form drop down lists all forms associated with your user account except the currently active form.
-
- Click the Edit Lookup button to create a Lookup Rule for the Data Source.
-
Your lookup rule needs to match a field/column in the current form/record to a field in the lookup datasource. Typically you will use the recordID field when linking records together (though you can link records together on any identifier).
-
The example below shows how you would setup the rule when using Lookup Data to pull records from a Subform.
-
-
Use Max Rows to specify the maximum number of records to retrieve.
- Enter 0 to return all matches.
-
Select the field you want to Sort By, and the desired Sort Order, either Ascending or Descending.
- Click the Finish button to save your configuration and return to the Lookup DataSource page.
To edit an alternate Data Source:
-
On the Lookup DataSource page, select the Data Source you want to edit in the list of Data Sources, then click Edit Lookup DataSource.
-
The Data Source Configuration Settings screen displays. The screen shows the current values for the selected Data Source.
-
-
Edit the Data Source settings as desired, then click the Finish button to save your changes.
To delete an alternate Data Source:
-
On the Lookup DataSource page, select the Data Source you want to delete in the list of Data Sources, then click Delete Lookup DataSource.
-
A confirmation message displays.
-
-
Click the Yes button to continue with the deletion.
-
Click the No button to cancel the deletion and keep the Data Source.
-
Using Alternate DataSource Wildcards
Alternate DataSource Wildcards are available in the Insert Wildcard selection window when available (when lookup data is enabled for example). You can identify them by their prefix (based on the name you gave to the lookup data). They can be selected and used just like regular wildcards.
Creating Repeating Regions
When you use a 'child' form (SubForm) as a Data Source, the Insert Wildcard selection window includes four specialized wildcards used to create 'Repeating Regions.' A Repeating Region lets you loop over multiple records returned via the Lookup Data. The function of each wildcard is described below.
-
Start Repeating Region - marks the start of a Repeating Region.
-
End Repeating Region - marks the end of a Repeating Region.
-
Repeating Region Index - provides an incremental counter for retrieved records within the Repeating Region.
-
Record Count - shows the total count of all retrieved records within the Repeating Region.
Repeating Region Example
In the below image, we've inserted a Repeating Region and output a few of the Wildcards from the from.
After submitting a form with two linked child records (the form in this example uses a linked SubForm), the result appears as shown below. You can see in this example how each 'looked up' record is output inside the Repeating Region.
Using Alternate Wildcards Outside of a Repeating Region
You can use Alternate Wildcards outside of a Repeating Region. When you do, the first row in the returned data set is used .Lookup Data and Conditional Content
Once you've enabled Lookup Data for a document and configured one or more alternate Data Sources, you can use elements from those Data Sources when configuring a rule for Conditional Content.
Showing One Row per Value (Summary Tables)
A Lookup DataSource returns one row for each matching record, and a Repeating Region outputs every one of those rows. There is no setting to group rows by a field or to combine several records into one row. Sort By only puts records with the same value next to each other.
To show one row per value instead, for example one row per sales rep with the number of records and the record details, add a separate Lookup DataSource for each value:
-
On the Lookup DataSource page, add a Data Source for the first value, for example named Sarah, with a Lookup Rule where the Sales Rep field equals Sarah Lee.
-
Repeat for each value, giving each Data Source its own name (for example Mike for Mike Chen).
-
In the document, add one table row per Data Source. Type the value in the first cell, use Record Count for the number of records, and put a Repeating Region inside a single cell to list that value's records.
For example:
<table>
<tr><th>Sales Rep</th><th>Records</th><th>Opportunities</th></tr>
<tr>
<td>Sarah Lee</td>
<td>[Sarah:Record Count]</td>
<td>[Sarah:Start Repeating Region][Sarah:Opportunity Name]<br>[Sarah:End Repeating Region]</td>
</tr>
<tr>
<td>Mike Chen</td>
<td>[Mike:Record Count]</td>
<td>[Mike:Start Repeating Region][Mike:Opportunity Name]<br>[Mike:End Repeating Region]</td>
</tr>
</table>
Keep in mind:
- The values are fixed in the document. A new value only appears after you add a Data Source and a row for it.
- Each value needs its own Data Source, so more than two values needs expanded lookup capacity (see Caveats and Limitations).
- Separate the items inside the cell with a line break (
<br>) or a non-breaking space ( ). With a comma, the space after it is removed and a comma is left after the last item.
Caveats and Limitations
-
When used with Dynamic PDFs, Lookup Data cannot be included in the Document Header or Document Footer; it can be used in the Document Body only.
-
Repeating Regions cannot be created inside Conditional Content.
-
When using Lookup Data from a SubForm in a filter for Conditional Content, the Conditional Content should be included within the Repeating Region to be evaluated on a per-row basis. Root-level wildcards refer to the source record.
-
Fields with the same underlying ID will not be correctly referred to in expressions (Conditional Content rules and inline conditions) when referenced outside of a Repeating Region.
-
When a Data Source finds no matching records, its wildcards outside a Repeating Region (including Record Count) output
[undefined var]instead of a value. -
Do not give a Data Source a name that is the end of another Data Source's name (for example Ron and Aaron). Wildcards of the longer name then fail to output outside a Repeating Region.
-
On our standard plans, 2 lookups can be defined per PDF or email. For Expanded lookup capacity, enquire about our Enterprise Plus Plans
0 Comments