Text Templates (Text, CSV, JSON, XML)
Form Connectors that can generate and upload custom file outputs can do so in the following formats:
- Body โ An Email connector option that allows the body of an email to be generated using HTML.
- CSV โ Generate a CSV file using a Text (.txt) template.
- JSON โ Generate a JSON file using a Text (.txt) or JSON(.json) template.
- Excel โ Generate an Excel file using an Excel (.xlsx) template.
- Word โ Generate a Word file using a Word (.docx) template.
- PDF โ Generate a PDF file using a Word (.docx) or Excel (.xlsx) template.
- Plain Text โ Generate a Text file using a Text (.txt) template.
- XML โ Generate an XML file using a Text (.txt) or XML (.xml) template.
This article focuses on custom Text (.txt) templates and using HTML in the body of an email. Providing examples of static text, form-captured data, and repeatable outputs.
Body
This option is specific to the Email Connector and allows you to tailor the body of an email with custom HTML.
On an Email Connector, click the Customize Email option to show the Body property. You can add your own static text and reference field data names to output form-captured data in a custom HTML body.
Example
<h3> HTML Body</h3>
<table border=1>
<tr>
<td>First Name</td>
<td>{{first_name}}</td>
</tr>
<tr>
<td>Last Name</td>
<td>{{last_name}}</td>
</tr>
<tr>
<td>ID Number:</td>
<td>{{id_number}}</td>
</tr>
<tr>
<td><h4>Special Achievements</h4></td>
</tr>
{{!REPEATSTART}}
<tr>
<td>Special Achievement:</td>
<td>{{special_achievement}}</td>
</tr>
<tr>
<td>Date Achieved:</td>
<td>{{date_achieved}}</td>
</tr>
{{!REPEATEND}}
</table>
Output
CSV
This option generates a .csv output using a .txt file. Depending on your needs, the .txt file can be formatted with static text and form-captured data, including repeatable data, for the column/row structure.
Example
first_name;last_name;special_achievement;date_achieved
{{!REPEATSTART}}{{first_name}};{{last_name}};{{special_achievement}};{{date_achieved}}
{{!REPEATEND}}
Output
JSON
This option generates a .json output using a .txt file. Depending on your requirements, the .txt file can be formatted using JSON syntax to control the structure with name/value pairs and arrays for repeatable data.
Example
{
"First_Name": "{{first_name}}",
"Last_Name": "{{last_name}}",
"Special_Achievements": [
{{!REPEATSTART}}
{
Special_Achievement: "{{special_achievement}}",
Date_Achieved: "{{date_achieved}}"
},
{{!REPEATEND}}
],
"ID_Number": "{{id_number}}"
}
Output
Plain Text
This option generates a .txt output using a .txt file. Depending on your requirements, the .txt file can be formatted with static text and our Data Template Syntax for form-captured data, including repeats.
Example
This is a plain text template.
First Name: {{first_name}}
Last Name: {{last_name}}
ID Number: {{id_number}}
{{!REPEATSTART}}
Special Achievement: {{special_achievement}}
Date Achieved: {{date_achieved}}
---------------------------------------------
{{!REPEATEND}}
Output
XML
This option generates a .xml output using a .txt file. Depending on your requirements, the .txt file can be formatted using XML syntax to control the structure with attributes, including repeatable captured data.
Example
<person>
<First_Name>{{first_name}}</First_Name>
<Last_Name>{{last_name}}</Last_Name>
<Special_Achievements>
{{!REPEATSTART}}
<Special_Achievement>
<Achievement>{{special_achievement}}</Achievement>
<Date_Achieved>{{date_achieved}}</Date_Achieved>
</Special_Achievement>
{{!REPEATEND}}
</Special_Achievements>
<ID_Number>{{id_number}}</ID_Number>
</person>