--- title: "Add document record fields - XML" slug: "add-document-record-fields-xml" description: "Learn how to add and configure record fields in XML documents, ensuring proper data exchange and validation for seamless integration." tags: ["Task topic"] updated: 2026-07-08T13:41:16Z published: 2026-07-08T13:41:16Z canonical: "docs.staedean.com/add-document-record-fields-xml" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Add document record fields - XML To each document record, add the data fields which values must be exchanged. For external file-based documents, set up the fields in line with naming in the file. For **XML** documents, fields are always of type string, to enable type conversions. This topic explains how to add record fields to an **XML** document. If fields are already initialized for the document, selected for the record, or copied to the record, you can review and complete the setup for these fields. To do so, skip step 6. ### Steps 1. Click **Connectivity studio - Integration Design**. 2. Click the **Documents** tab. 3. In the list, find and select the desired **XML** document. 4. Click **Edit**. 5. In the **Records** section, in the **Record list** find and select the desired record. 6. On the **Fields** tab, click New. 7. As a field name, enter a free-definable name. Usually, this is the name used in the external file. In the **Field name** field, type a value. > [!NOTE] > Note > > The value of this field cannot have spaces. 8. As a record table, enter a free-definable name. Usually, this is the name used in the external file. The value, as entered in the **Field name** field, is the default value. You can change this value. In the **Record table field** field, type a value. > [!NOTE] > **Note** > > The value of this field cannot have spaces. 9. Indicate if the field is a key field for the record. Select the **Key field** check box. 10. Indicate if the field is mandatory to be filled. If on processing the document, the field has no value and **Mandatory** is set to: - **Yes**, an error is given, and the document is not processed. - **Warning**, a warning message is given, but the document is processed. - **No**, the document is processed. In the **Mandatory** field, select an option. 11. Set the field length carefully. Make sure the number of characters is sufficient to contain the value. If you set the length too short, the value is truncated. In the **Length** field, enter a number. 12. XML elements can have attributes. In a document, on a record, you can use a field value as attribute. Use the attribute type to specify which element the field belongs to. You can choose these attribute types: In the **Attribute Type** field, select an option. - **Field**: The field value is an attribute of another field element in the XML file. Make sure to fill in the **Attribute of** field. - **Root**: The field value is an attribute of the root record element in the XML file. - **Expression**: In a complex XML file, a value that is required for the current record, can be positioned at a different place. You can use an XPath expression to navigate through elements and attributes in an XML document to find the required value. Make sure to fill in the **Expression** field. > [!NOTE] > Note > > The XPath expression is only used on reading an XML file. 13. If you choose '**Field**' as attribute type, define the field of which the current field is an attribute. In the **Attribute of** field, enter or select a value. 14. If the field name in the record differs from the attribute name in the XML file, define the attribute name in the XML file. In the **Attribute name** field, type a value. 15. If you choose '**Expression**' as attribute type, define the XPath expression. In the **Expression** field, type a value. 16. On read, you can have the value not only searched for the in the record tag, but also in the children of the record tag. The first-found value is used. Select the **Search in children** check box. 17. On write, if the field has no value, the field is not written to the XML file, even if the attribute has a value. So, there's no reference to the field in the file at all. Select the **Skip empty** check box. 18. Indicate if the system must check the length of an incoming field value against the maximum length of the field. If the value exceeds the maximum length and **Validate field length** is set to: - **None**: The value is truncated without a warning. This is the default option. - **Warning**: A warning is logged, the value is truncated, and processing continues. - **Error**: The message fails, a descriptive error is logged, and processing stops. In the **Validate field length** field, select an option. > [!NOTE] > Note > > - This setting has no effect if the field has no maximum length defined. > - If the incoming value is empty, no length validation is performed. > - Validation applies only to importing data. Exporting data is not affected. 19. Sub-task: Set external references for record. 1. In the **Line details** section, set the external references for the record. You can indicate which of the records fields contains the unique ID of the record in the external database. In this way, you link the external ID to the record ID. In the **External reference** field, enter or select a value. > [!NOTE] > **Note** > > Usually, you only use this for an **ODBC** connection with CRM or if you use web services. 2. You can indicate which of the records fields contains the revision of the record in the external database. In this way, you find and link the latest revision to the record ID. In the **Revision field** field, enter or select a value. > [!NOTE] > **Note** > > You can only use this field in combination with the **External reference** field. 20. Close the page.