Knowledgebase

Article number: 301399

Form Submission Export Formats: CSV & XML

Form submissions over a specified period can either be viewed in Sitekit CMS admin or exported to CSV or XML format.

CSV Format

  • The CSV file format contains a comma delimited list of data elements, with each row of data on a new line.
  • Each data element is double-enquoted (i.e. enclosed by "..." ) in order to preserve line breaks and commas within the data.
  • Data is grouped in blocks, the first line of which contains column headings describing the data under that column.
  • When the configuration of a form changes, form submissions appear in a new block, after a blank line, with new column headings. The form configuration changes when:
    • a field is added to a form
    • a field is deleted from a form
    • a field is renamed
    • the fields are re-ordered
  • 4 columns are always included: TimeStamp and ID (first 2 columns) and BrowserInfo and IP (last 2 columns). The intervening columns represent the elements in the submitted form.
  • Label elements, page break elements and attachment button elements are always excluded from the CSV file.

XML Format

  • The XML file format contains a list of form submissions represented as nodes in an XML Document.
  • Briefly, the format of the XML document is as follows:
    • The root element is form_submissions and has an attribute name whose value is the name of the form.
    • the form_submissions node contains zero or more submission elements which each represent an individual form submission.
    • each "submission" element has an attribute id whose value is the submission ID for that submission.
    • each "submission" element has a child element timestamp whose value is the date-time at which the submission was made.
    • each "submission" element has one or more child elements named form_element which each represent an element on the submitted form.
    • each "form_element" element has an attribute id whose value is the element ID of the element within the submitted form.
    • each "form_element" element has EITHER
      • 4 child elements.
        • element_name whose value is the name of the element.
        • element_type whose value is the type of the element ( possible values are enumerated in the schema).
        • element_order whose value is the order in which the element appears on the form.
        • user_input whose value is the submitted data for the form element.
      • OR
      • text representing the submitted data for the form element.
    • each "submission" element has a child element browser_info whose value is the identification string of the browser from which the submission was made.
    • each "submission" element has a child element ip whose value is the IP address of the computer from which the submission was made.
    • each "submission" element has a child element attachments.
    • each "attachments" element has zero or more child elements named attachment which each represent a file attached to the submission.
    • each "attachment" element has an attribute id whose value is the attachment ID of the attached file, and an attribute url whose value is the URL which describes the location of the attached file.

The XML file format is defined by the following xml schema:

<?xml version="1.0" ?>
<xsd:schema id="form_submissions"
	elementFormDefault="qualified"
	targetNamespace="http://www.sitekit.net/FormSubmissions.xsd"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:skforms="http://www.sitekit.net/FormSubmissions.xsd">

	<xsd:element name="form_submissions">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="submission" minOccurs="0" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="timestamp" type="xsd:string" />
							<xsd:element name="form_element" maxOccurs="unbounded">
								<xsd:complexType mixed="true">
									<xsd:group ref="skforms:element_configuration" minOccurs="0">
									<xsd:attribute name="id" type="xsd:integer" />
								</xsd:complexType>
							</xsd:element>
							<xsd:element name="browser_info" type="xsd:string" />
							<xsd:element name="ip" type="xsd:string" />
							<xsd:element name="attachments">
								<xsd:complexType>
									<xsd:sequence>
										<xsd:element name="attachment" minOccurs="0" maxOccurs="unbounded">
											<xsd:complexType>
												<xsd:attribute name="id" type="xsd:integer" />
												<xsd:attribute name="url" type="xsd:string" />
											</xsd:complexType>
										</xsd:element>
									</xsd:sequence>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
						<xsd:attribute name="id" type="xsd:integer" />
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
			<xsd:attribute name="form_name" type="xsd:string" />
		</xsd:complexType>
	</xsd:element>

	<xsd:group name="element_configuration">
		<xsd:sequence>
			<xsd:element name="element_name" type="xsd:string" />
			<xsd:element name="element_type">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:enumeration value="Label" />
						<xsd:enumeration value="TextBox" />
						<xsd:enumeration value="TextArea" />
						<xsd:enumeration value="NameReplyTo" />
						<xsd:enumeration value="EmailReplyTo" />
						<xsd:enumeration value="Email" />
						<xsd:enumeration value="DateTextBox" />
						<xsd:enumeration value="NumberTextBox" />
						<xsd:enumeration value="Address" />
						<xsd:enumeration value="CheckBox" />
						<xsd:enumeration value="RadioButtonGroupHorizontal" />
						<xsd:enumeration value="RadioButtonGroupVertical" />
						<xsd:enumeration value="DropDownSingle" />
						<xsd:enumeration value="DropDownMulti" />
						<xsd:enumeration value="Hidden" />
						<xsd:enumeration value="PageBreak" />
						<xsd:enumeration value="AttachmentButton" />
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="element_order" type="xsd:integer" />
			<xsd:element name="user_input" type="xsd:string" />
		</xsd:sequence>
	</xsd:group>
 
</xsd:schema> 

For Example

<?xml version="1.0" ?>
<form_submissions form_name="My Example Form" xmlns="http://www.sitekit.net/FormSubmissions.xsd">
	<submission id="40083">
		<timestamp>30/10/2003 11:29:10</timestamp>
		<form_element id="0">
			<element_name>
				<![CDATA[ Label ]]>
			</element_name>
			<element_type>Label</element_type>
			<element_order>0</element_order>
			<user_input>
				<![CDATA[ This is a label ]]>
			</user_input>
		</form_element>
		<form_element id="2">
			<element_name>
				<![CDATA[ Text Box ]]>
			</element_name>
			<element_type>TextBox</element_type>
			<element_order>1</element_order>
			<user_input>
				<![CDATA[ This is some text I typed in. ]]>
			</user_input>
		</form_element>
		<form_element id="3">
			<element_name>
				<![CDATA[ Text Area ]]>
			</element_name>
			<element_type>TextArea</element_type>
			<element_order>2</element_order>
			<user_input>
				<![CDATA[ Hello world! ]]>
			</user_input>
		</form_element>
		<browser_info>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)</browser_info>
		<ip>192.168.128.96</ip>
		<attachments>
			<attachment id="1" url="/GetAttachment.aspx?id=1" />
			<attachment id="2" url="/GetAttachment.aspx?id=2" />
		</attachments>
	</submission>
</form_submissions> 

Related questions