Import from XML


Interface for setting the parameters of actions of type Import from XML.

Actions of the type Import from XML allow to fill form fields with the content of an XML document. To do this, for each form field to be populated, an XPath specified to an appropriate value in the XML.

Parameters

Details for importing form data

XML source
Selection of an XML file, which should be used as XML source. Available are Formcycle files, Client files, files loaded via a URL (external resource), form record attachments or files from previous actions. See actions for a list of supported URL protocols.
XSL transformation
Optionally, an XSL template can be specified which transforms the XML document before evaluation.

Values to be set

Field name
Name of the form element whose value will be set.
XPath
XPath to a value in the XML document whose value is entered into the form field.

Action variables

Actions of type Import from XML provide Action variables which can be used in subsequent actions.

Standard action variables

[%$<action name>.SUCCESS%]
Return whether action was successfully executed. Returns Boolean (true/false).
[%$<action name>.RESULT%]
Return all results provided by the action in structured form.
[%$<action name>.ERROR_CODE%]
The error code thrown in case of an error in the action. Empty if no error occurred.
[%$<action name>.ERROR_MESSAGE%]
The thrown error message in the action's error case. Empty if no error occurred.

Action specific action variables

[%$<action name>.ERROR.message%]
Error message returned if the PDF file could not be written to the file system, the specified URL does not match a valid format, no source file could be determined, the file format of the source file is not supported, an error occurs while processing the XML data, or the XSLT transformation was not successful.

Example

For clarification, here is a brief example of how to use XPaths. For example, the XML document looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<xfc-data xfc-version="7.0.0" generation-date="2021-07-27 11:23:43.190 CET">
<processes>
 <process process-uid="f1e677ad-012d-4586-884b-ac2ee029cb00" creation-date="2021-07-27 11:23:43.0 CET" project-name="XML" status="">
  <form version="1">
   <field name="upl1">
    <plainValue><![CDATA[]]></plainValue>
    <values count="0"/>
    <label><![CDATA[]]></label>
   </field>
   <field name="tf1">
    <plainValue><![CDATA[foobar]]></plainValue>
    <values count="1">
     <value index="0"><![CDATA[foobar]]></value>
    </values>
    <label><![CDATA[]]></label>
   </field>
   <field name="xf-action">
    <plainValue><![CDATA[btnPrev]]></plainValue>
    <values count="1">
     <value index="0"><![CDATA[btnPrev]]></value>
    </values>
    <label><![CDATA[]]></label>
   </field>
  </form>
 </process>
</processes>
</xfc-data>

To select the value of the field named tf1, the following XPath can be used.

//processes//field[@name="tf1"]/plainValue/text()