Export Field

Export fields create blocks of answer data for use by other systems. For example they can prepare data for Laserform documents.
An export field appears as an element called ExportList in the session XML, which can then be easily extracted by external systems.
Note that variables referenced within an export field contribute to relevancy so any dependencies between variables will need to be reinforced within the export field by using the If Operator or spans (remember spans always occur outside fields never inside them).
An export field may occur anywhere within a template document and should occupy a complete MS Word paragraph.
The general form of an export field is:
{
Export
kind-identifier name-identifier
Occurrence
occurrence-expression
With
variable-1
As
expression-1
,
...
,
variable-K
As
expression-K
}
where:
kind-identifier
indicates the target system and would be agreed with the consumer of the exported data (eg "LaserForm")
name-identifier
indicates the name of the export block. This is needed even if there is only 1 export block (for Laserforms this indicates the specific Laserform form for which the data is intended)
Occurrence
a further indication of name on the export block. (for Laserforms this becomes the text of the link to the Laserform on the output page). This component is optional.
With
component indicates the variables to export. This is optional although it would be rare to use an export statement without a With component
Note that all identifiers must be enclosed by single quotes if they contain any non-alpha-numeric character.

Example 1

Computable variables never occur explicitly in the answers XML file, but they can be exported.
Consider a computable variable
LegallySafe
which is defined as a boolean in terms of one or more question variables such as "Are there any special terms?" and "In which country is the buyer company incorporated?".
The export field:
{Export Summary Completeness With Complete As db_questionnaire_complete, Safe As LegallySafe}
will add the following elements to each session XML:
<ExportList Kind="summary" Name="completeness" RepeatContext="">
<ExportItem name="complete">
<Value>...</Value>
</ExportItem>
<ExportItem name="safe">
<Value>...</Value>
</ExportItem>
</ExportList>
where the ... values will be true/false depending upon whether all relevant variables are known (complete) and how certain critical questions have been answered (safe).

Example 2

Consider a company with multiple directors.
The export field:
[
Repeat DirectorCount
{Export Details Director Occurrence RepeatCounter With Name As DirectorName, Age As DirectorAge}]
will add the following elements to each session XML when the directors are John (38), Mary (42) and Helen (35):
<ExportList Kind="details" Name="director" Occurrence="1" RepeatContext="[1]">
<ExportItem name="name">
<Value>John</Value>
</ExportItem>
<ExportItem name="age">
<Value>38</Value>
</ExportItem>
</ExportList>
<ExportList Kind="details" Name="director" Occurrence="2" RepeatContext="[2]">
<ExportItem name="name">
<Value>Mary</Value>
</ExportItem>
<ExportItem name="age">
<Value>42</Value>
</ExportItem>
</ExportList>
<ExportList Kind="details" Name="director" Occurrence="3" RepeatContext="[3]">
<ExportItem name="name">
<Value>Helen</Value>
</ExportItem>
<ExportItem name="age">
<Value>35</Value>
</ExportItem>
</ExportList>

Related content