Exporting an XML file on submission
In order to use the Export as File action, you'll need to create a template, which tells XFP how to convert information from the form into a XML file.
To do this:
Navigate to Templates in the top navigation bar (under the form title).
Click Create Template.
A popover will open, asking which type of action we want to create a template for. Choose Export as File under the File Output section, and click Next.
We'll then be taken to the template builder for this action.
It is also possible to access the template builder from within a rule, by choosing Create new... when selecting a template in a Then block.
Set the title of your template, and click Next.
Choose XML as the type of file to export, and edit the settings if necessary. The settings available are:
- XML Template: The body of the XML document
- Field XML: The XML markup for each field.
When completing these fields, you can use the following placeholders:
[FIELD_XML]- one or more instances of the Field XML template, with all placeholder populated.
[FIELD_NAME]- the name of the question or variable.
[FIELD_VALUE]- the question answer or variable value.
Once you've set up these fields, click Next.
Choose the fields to include in your file. You can either choose all fields, or custom. Choosing custom will allow you to select exactly the fields you want to include. It is possible to include question answers, standard form data e.g. Form Title, and the value of logic formulae.
Tip: To include most fields, click Select All and then uncheck any you do not want to export.
Once you've selected each field you want to Export, click Next.
Choose a connector to use to transmit the exported file, or create a new one.
Click Save to create the template.
To make this action fire when your form is filled in, you will need to add it to a rule - see Building a Rule.