Posting XML output
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
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:
Here you need to click on 'Create'. The following is an example XML mapping template:
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.
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:
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:
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':
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:
Now you've done this, when a form is submitted, an XML file will also get created.
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 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:
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:
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:
*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.
In the example below, Cambridge City Council set up integration with both Information@Work EDMS and Posted XML to the Northgate Council Tax system:
Just like any form integration, the Form Portal will show details of the request and response.
Plus, like any other integration, it will retry integration automatically if the back office is unavailable etc.
When you have completed your mapping above, you can check the file is being created as expected by going into the and clicking on the Documents tab as shown below:
If you have done this correctly, you can view the action within the . This time click on the Integration tab.