Liftoff

Liftoff Documentation

Using data-driven content with Pageflex

Before you begin...

This article should be used in conjunction with the conventions laid out in the Creating user input fields for Pageflex . A healthy understanding of the Liftoff XML descriptor file should be used as a prerequisite to reading this article.

Overview

Liftoff employs a powerful, yet simple approach to integrating native and external data sources into the web to print workflow. These features allow you to integrate textual data, lists and images with your design templates and form presentation.

There are two types of data you can merge with your templates:

Native System Variables
A native system variable is data that is readily present and available using variable injection commands. The most common and present source is customer profile information. For example, if you wanted to inject a logged in customer's name into a template, you can simply nest the command @Customer.Name@ in the inner text of the variable XML element. Example:
<variable order="1" name="ContactName" attributes="" maxLen="50" type="text" caption="Name">@Customer.Name@</variable>.

Data Driven Values
Liftoff incorporates a powerful "database in the cloud" solution we call Records. This robust feature gives you the ability to create customizable data tables for many purposes including asset management, list management, contact management, blogs, news feeds, and best of all - the ability to integrate live data into your web to print forms and templates.

Working with native system variables

As described in the overview, you can incorporate customer profile data into your templates using a few very simple commands. The current supported native entity is the Customer object. These are accessible by implementing an open and closing @ symbol with the Customer.<Field> convention nested between them. Below are the acceptable variables available for the Customer object:

@Customer.Name@
@Customer.Address1@
@Customer.Address2@
@Customer.City@
@Customer.State@
@Customer.PostalCode@
@Customer.Country@
@Customer.Phone@
@Customer.Email@

Custom Customer Fields
The convention for using custom customer fields is very similar to the notations above. If you have a custom customer field named "Company Name", you would notate this as:
@Customer.Custom_CompanyName@. The convention calls for the prefix of Custom_ appended to the variable name. Spaces are not allowed in variable names, thus if you have spaces in your field name, they should be omitted from your variable name. Example: the field Company Name translates to a variable name of Custom_CompanyName.

Example XML document using native system variables

<?xml version="1.0" encoding="UTF-8"?>
<document>
 <groups>
  <group page="1" order="3" name="Imprint Information">
   <variable order="1" name="Name" attributes="" maxLen="50" type="text" caption="Name">@Customer.Name@</variable>   
   <variable order="2" name="Title" attributes="" maxLen="50" type="text" caption="Title">@Customer.Custom_Title@</variable>
   <variable order="2" name="Address" attributes="" maxLen="50" type="text" caption="Address">@Customer.Address1@</variable>
   <variable order="6" name="CityStatezip" attributes="" maxLen="50" type="text" caption="City, State Zip">@Customer.City@, @Customer.State@  @Customer.PostalCode@</variable>
   <variable order="7" name="Email" attributes="" maxLen="50" type="text" caption="Email">@Customer.Email@</variable>
  </group>
 </groups>
</document>

Implementing data-driven records

Before you can begin using data-driven data in your templates. You must have first established a table using the Content->Records feature. For the examples in this section, we're going to assume that we have a table called Contacts that have the following fields Name, Address, CityStateZip and Email.

Creating a drop down list
To implement a drop down list, we're going to use the object type recordselect as a new variable:

<variable order="1" name="Name" attributes="recordType:Contacts,displayField:Name" type="recordselect" caption="Name"></variable>

In the attributes section, the value recordType:Contacts, indicates that we're pulling data from the Contacts table. displayField:Name states that we want to use the field Name as the display value for our selector.

If implemented properly, you should see a drop down box that pulls from the designated table using the field you indicated for the display value.

Sorting records in a record variable
Record variables present you a way to sort the returned values based on an exist record field. You may also specify sort direction including random sorting. Below is an example of sorting the contacts list by the Name field:

<variable order="1" name="Name" attributes="recordType:Contacts,displayField:Name,sortFieldCode:Name,sortOrder:desc" type="recordselect" caption="Name"></variable>

The sortFieldCode attribute tells the parser which field you're choosing as the sort by field. sortOrder designates the direction. The following values are applicable for sort order:

asc for ascending sort direction
desc for descending sort direction
rand for random sorting

Using selected data to populate other fields
There may be cases where you desire to have a customer's selection to drive the values that appear in subsequent fields on your form. Mapping fields to a drop down box is relatively easy.

For this example, we want the change of a selection to the Name box to pre-populate the address fields on the form. This function works for both the text and static control types.

To implement the pre-fill, modify your text or static control's attributes to contain a coma separated value of recordselectVariable and recordField such as recordselectVariable:var_Name,recordField:Address.

recordselectVariable refers to the control you're binding the result set to. In this case, we're binding to Name. When declaring this binding, ensure you're prefixing the control name you're binding to with _var.

Example populating address:
<variable order="1" name="Address" attributes="recordselectVariable:var_Name,recordField:Address" required="Address is required." maxLen="50" type="text" caption="Address *"></variable>

Example populating city, state and zip:
<variable order="1" name="Address" attributes="recordselectVariable:var_Name,recordField:CityStateZip" required="City State Zip is required." maxLen="50" type="text" caption="City, State and Zip*"></variable>

Variable Names

Variable names are case sensitive. If your form does not work, please ensure they're typed exactly as defined in your records table.

XML example using record selection

<?xml version="1.0" encoding="UTF-8"?>
<document>
<groups>
<group page="1" order="3" name="Custom Information">
<variable order="1" name="Name" attributes="recordType:Stores,displayField:Name,sortFieldCode:Name,sortOrder:desc" type="recordselect" caption="Location"></variable>
<variable order="2" name="EmpName" attributes="" required="Name is required." maxLen="50" type="text" caption="Name *"></variable>
<variable order="2" name="Title" attributes="" required="Title is required." maxLen="50" type="text" caption="Title *"></variable>
<variable order="1" name="Address1" attributes="recordselectVariable:var_Name,recordField:Address1" required="Address is required." maxLen="50" type="text" caption="Address *"></variable>
<variable order="1" name="City" attributes="recordselectVariable:var_Name,recordField:City" required="City is required." maxLen="50" type="text" caption="City *"></variable>
<variable order="1" name="State" attributes="recordselectVariable:var_Name,recordField:State" required="State is required." maxLen="50" type="text" caption="State *"></variable>
<variable order="1" name="ZIP" attributes="recordselectVariable:var_Name,recordField:ZIP" required="ZIP is required." maxLen="50" type="text" caption="ZIP *"></variable>
<variable order="2" name="Phone" attributes="recordselectVariable:var_Name,recordField:Phone" maxLen="50" type="text" caption="Phone"></variable>
<variable order="2" name="Extension" attributes="" maxLen="4" type="text" caption="Extension"></variable>
<variable order="2" name="Cell" attributes="" maxLen="50" type="text" caption="Cell"></variable>
<variable order="2" name="Fax" attributes="" maxLen="50" type="text" caption="Fax"></variable>
<variable order="2" name="Email" attributes="" required="Email is required." maxLen="50" type="text" caption="Email *"></variable>
</group>
</groups>
</document>

Using data-driven content with Pageflex


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.