Posting XML output

Before you start

In order to do this, you need to ensure that the Data Mapping function (shown below) is enabled. If you can't see this it is not enabled and you should raise a ticket through the help desk to get it enabled.

Where to access the ability to set the format of your XML

Mapping the XML file format

The first thing you need to do if you want your form to output an XML file, is tell it the format of the file. To do this you need to click on the 'Data Mapping' link as shown in the screenshot above.

When you do, you will see this:

Where any data mappings will be shown.

Here you need to click on 'Create'. The following is an example XML mapping template:

An XML template - this can be whatever structure desired

You can see the XML file contains FirstName, Surname, MobileNo, Email, ServiceRequestType, HighPriority, Details as pieces of data.

Notice that you basically need to add an empty tag for anything that should be mapped from data the customer will provide in the form. Where the value is always the same for the form i.e. the Service Request Type the actual value is populated. This is simply to illustrate you might need to pass a value to the back office which the customer may not know but that the back office needs.

Last, you can see the name of the mapping is 'GraffitiFile'. This is important later when you're creating the action to save it somewhere.

Linking the form data to your XML format

Once the XML mapping template is added, open design mode in eDesigner for your form. Select Mapping Designer:

Then click on the name of the file template. The reason this screen appears is that it is technically possible to have multiple mapping files output:

Accessing the Mapping Designer in the form

Then click on the name of the file template. The reason this screen appears is that it is technically possible to have multiple mapping files output:

The list of any mapping templates available to the form

You'll then be presented with a UI with three columns.

  • The first column contains any pages in your form.

  • The second column is populated when you click on a page as it is the ID for each of the questions that are present on the page you selected

  • The third column is the XML template converted into a bulleted list to remove the technical look of XML

The task you now have is to click on each question you want in your XML and then click on the relevant XML element you want to map it to. When you do this you'll see a button that says 'Add Mapping':

Mapping form content to the XML template

Because the question IDs are what are shown in here, it is a good idea to ensure the ids are obvious as to which question they relate to.

Once you've mapped content to all it will look like this:

Mapped XML content

ServiceRequestType doesn't need a mapping as it is a fixed value and it's useful to know that anything that is fixed should be set in the mapping template.

Now you've done this, when a form is submitted, an XML file will also get created.

Masking XML requirements

Sometimes an XML file needs the answer the customer provides to be converted into something the back office understands. For example if the customer was being asked whether they thought some graffiti was offensive they might be given a Yes/No option. But the back office expects the value for priority to be a 1 or a 2. Where 1 means high priority and 2 means not.

To cater for this, the 'value' that your enter in the 'Value' field when creating your list is what will be passed in the XML. I.e. if they selected yes with the list set up as below, the XML would be populated with 1:

The values from drop downs will go into the XML not the labels (i.e. the Options)

Viewing the XML

When you have completed your mapping above, you can check the file is being created as expected by going into the Forms Portal and clicking on the Documents tab as shown below:

Accessing the XML file

The XML file is created as we mapped before. One can see the details the customer entered are mapped and that a) the Service Request Type is populated and b) the High Priority value is 1 not Yes:

<Issue>
<FirstName>John</FirstName>
<Surname>Mc</Surname>
<MobileNo>07713491749</MobileNo>
<Email>john.mcmahon@ieg4.com</Email>
<ServiceRequestType>GRAFFITI</ServiceRequestType>
<HighPriority>1</HighPriority>
<Details>It's really bad. It's just outside the window of 10 Downing Street.</Details>
</Issue>

Adding an action

Now you're happy you've got the XML how you like it, you can now set up an action to:

  • Save it to a file location

  • Send it to an API

To add an action you need to click on the 'Actions' link found here in Form Details:

Where to add actions that will be fired when the form is submitted

Note - because an action can be different from one environment to another, you need to do this for EACH environment.

You will then need to click on the 'Advanced Create' button. This will then present you with the actions available on your own environment.

For simplicity we've limited the list to the four most commonly used:

Adding an action

*If this option is not available please log a ticket through help.ieg4.com and they can enable this. When this is selected you then simply need to complete all of the different settings, which are documented below.

In this case we will select 'Post Data to Url'.

This then has the following settings:

Name

PostDataToUrl

Description

Any name you like - this is what shows in the forms portal

Back Office URL

The URL of the API you want to post content to

Credential Type

Set this to: Specify

Username

N/A

Password

N/A

Domain

N/A

Back Office Proxy

TRUE

Back Office Proxy Namespace

Please contact IEG4 support for these details.

Back Office Proxy Issuer Name

Please contact IEG4 support for these details.

Back Office Proxy Issuer Secret

Please contact IEG4 support for these details.

Data Document Type

The name of your XML data mapping file that you mapped the XML for. I.e. GraffitiFile is the name of the one we created in the example.

Content Type

Set this to: xml

Data Encode Type

Can be set to blank.

Viewing the outcome of the action

If you have done this correctly, you can view the action within the Forms Portal. This time click on the Integration tab.

In the example below, Cambridge City Council set up integration with both Information@Work EDMS and Posted XML to the Northgate Council Tax system:

Successful XML Posting

Last updated

Was this helpful?