--- title: "Set up inbound definition - XML" slug: "set-up-inbound-definition-xml" description: "Set up inbound definitions for EDI messages in XML format, ensuring proper file distribution and error handling in D365 F&SCM." tags: ["Task topic"] updated: 2026-03-20T12:11:42Z published: 2026-03-20T17:44:19Z canonical: "docs.staedean.com/set-up-inbound-definition-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. # Set up inbound definition - XML Use inbound definitions when you receive EDI message files from the AS2 web app. Set up an inbound definition of type XML to move files in XML format from the general storage location to a specific storage location. To determine which file distribution definition applies, this data must be read from the file: - **Type**: The EDI message type of the data in the file. For example, '**Order**' or '**Invoice**'. - **Recipient**: The data in the file that indicates to which company in D365 F&SCM the data must be imported. ### Example XML file content examples, without and with namespace: - `<xml><invoice><header><id>invoice123</id><sender>ABC</sender></header></invoice></xml>` - `<xml xmlns=[namespace]><invoice><header><id>invoice123</id><sender>ABC</sender></header></invoice></xml>` Examples of XPath expressions that can be applied to this example: - `/*`: Finds the name of the first tag: invoice. Note: if you use * in the XPath expression, it finds the name of the tag instead of the tag value. - `/xml/invoice/header/sender`: Finds the value of the 'sender' tag: ABC. - `/ns:xml/ns:invoice/ns:header/ns:id`: Finds the value of the 'id' tag: invoice 123. Note: If the XML has a namespace, make sure to define the namespace in the Namespace field. When the inbound definition is run, in the expression, 'ns' is replaced with the defined namespace. ### Steps 1. Click **EDI integration design**. 2. Click **Projects**. 3. On the **Action Pane**, click **Design**. 4. Click **Inbound definition**. 5. Click **New**. 6. The sequence number defines in which sequence the inbound definitions are run. The inbound definition with the lowest sequence number is run first. In the **Sequence** field, enter a number. 7. Enter a meaningful name for the inbound definition. In the **Name** field, type a value. 8. Define the type of file to which the inbound definition applies. In the **Document type** field, select '**XML**'. 9. Define the connector for the inbound definition. The connector connects to the general storage location from where the EDI files must be distributed. For mandatory inbound definitions, the connector also defines the error location to which files are moved that cannot be processed. In the **Connector** field, enter or select a value. 10. You can define a filter to only select specific files when the inbound definition is run. The read filter is applied to the file name. **Example:** To only select XML files with order information, you can set the read filter to '**Order***.**xml**'. In the **Read filter** field, type a value. > [!NOTE] > **Note** > > - Applying a read filter is only useful if the files, as stored in the general storage location, have a name with specific information, such as the subject of the file. > - If you do not define a read filter, all files in the general storage location are considered. 11. You can make an inbound definition mandatory. If for a mandatory inbound definition, a file cannot be processed, the file is moved to the error location of the connector. **Example**: You have three inbound definitions defined to process files of type **XML**. As defined by the sequence, you can make the last run XML inbound definition mandatory. Consequently, if a file cannot be processed by any of the XML inbound definitions, something is wrong. In the **Mandatory** field, select the desired option. 12. Sub-task: Set up search definition. 1. Define from where in the file to get the: This information is used to determine the applicable file distribution definition. Expand the **Search definition** section. - **Type**: The EDI message type of the data in the file. For example, '**Order**' or 'Invoice'. - **Recipient**: The data in the file that indicates the applicable company in D365 F&SCM. 2. Enter the XPath expression to find the EDI message type of the data in the file. In the **Type search** field, type a value. 3. Enter the XPath expression to find, in the file, the data that indicates to which company in D365 F&SCM the data must be imported. In the **Receiver search** field, type a value. 4. If the XML has a namespace, define the namespace. In the XPath expressions, each tag name must be preceded with 'ns:'. When the inbound definition is run, 'ns' is replaced with the defined namespace. In the **Namespace** field, type a value. 13. Sub-task: Set up file distribution definitions. 1. Expand the **Definition** section. 2. Click **New**. 3. Define the EDI message type to which the file distribution definition applies. For example, '**Order**' or '**Invoice**'. On running the inbound definition, the applicable type is read from the file that is received from the **AS2 web app**. In the **Type found** field, type a value. 4. Define the company to which the file distribution definition applies. On running the inbound definition, the applicable company is read from the file that is received from the AS2 web app. In the **Receiver company** field, enter or select a value. 5. To distribute the files from the general storage location to the specific storage locations, a message is used. The message is used for two purposes: In the **Message** field, enter or select a value. > [!NOTE] > **Note** > > - Define the tutorial EDI message that is used to process the files from the specific storage location. > - The message is not run when the inbound definition is run. - The source connector of the message is used to define the storage location to which the files must be moved. - The source document of the message is used to rename the files, if the **Rename file** check box is selected. 6. You can have a file renamed when it is moved from the general storage location to the specific storage location. To rename the file, the write settings are applied of the source document of the defined message. Select the **Rename file** check box. 14. Sub-task: Enable inbound definition. 1. You can disable or enable an inbound definition. For example, you do not want to have an unfinished or untested inbound definition included in the inbound process. To: In the **Disable** field, select the desired option. - Enable an inbound definition, select **No**. - Disable an inbound definition, select **Yes**.