You can use EDI studio to receive EDI message files from the AS2 web app. To be able to do so, some specific setup is required. Key in the setup is the inbound definition.

To receive EDI messages using the AS2 protocol, first the AS2 web app is run. This app stores the EDI message files in a general storage location. On this general storage location, the inbound definitions are run in recurring mode (Process AS2 inbound queue). During this process, this data is searched for in an EDI message 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 FO the data must be imported. For example, the GLN.

Based on this data, the file is moved to a specific storage location for further processing. From this specific storage location, the file is processed with an inbound message.

You can use the AS2 - Inbound process, for example, to import data that must be processed by different messages, based on specific field values.


Administrator Administrator Start Start Set up inbound definition - XML 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 FO 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. Procedure 1. Click Connectivity studio EDI integration design. 2. Click Projects. 3. On the Action Pane, click Design. 4. Click Inbound definition. 5. Click New. 6. In the Sequence field, enter a number. 7. In the Name field, type a value. 8. In the Document type field, select 'XML'. 9. 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: - 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. In the Mandatory field, select the desired option. 12. Sub-task: Set up search definition. 13. Expand the Search definition section. 14. In the Type search field, type a value. 15. In the Receiver search field, type a value. 16. In the Namespace field, type a value. 17. Sub-task: Set up file distribution definitions. 18. Expand the Definition section. 19. Click New. 20. In the Type found field, type a value. 21. In the Receiver company field, enter or select a value. 22. 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: - 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. In the Message field, enter or select a value. 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. 23. Select the Rename file check box. 24. Sub-task: Enable inbound definition. 25. In the Disable field, select the desired option. Set up inbound definition - JSON Set up inbound definition - JSON Use inbound definitions when you receive EDI message files from the AS2 web app. Set up an inbound definition of type JSON to move files with data-object notation 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 FO the data must be imported. Example JSON file content example: {"Stores":["Lambton Quay","Willis Street"],"Manufacturers":[{"Name":"Acme Co","Products":[{"Name":"Anvil","Price":50}]},{"Name":"Contoso","Products":[{"Name":"Elbow Grease","Price":99.95},{"Name":"Headlight Fluid","Price":4}]}]} Examples of JSON path expressions that can be applied to this example: Manufacturers[0].Name: Finds the name of the first manufacturer: Acme Co. $..*[?(@.* == 'Acme Co')]: Finds the name of the token: Name. Note: JSON path expressions are case sensitive. Procedure 1. Click Connectivity studio EDI integration design. 2. Click Projects. 3. On the Action Pane, click Design. 4. Click Inbound definition. 5. Click New. 6. In the Sequence field, enter a number. 7. In the Name field, type a value. 8. In the Document type field, select 'JSON'. 9. 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 JSON files with order information, you can set the read filter to 'Order*.js'. In the Read filter field, type a value. 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. In the Mandatory field, select the desired option. 12. Sub-task: Set up search definition. 13. Expand the Search definition section. 14. In the Type search field, type a value. 15. In the Receiver search field, type a value. 16. Sub-task: Set up file distribution definitions. 17. Expand the Definition section. 18. Click New. 19. In the Type found field, type a value. 20. In the Receiver company field, enter or select a value. 21. 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: - 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. In the Message field, enter or select a value. 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. 22. Select the Rename file check box. 23. Sub-task: Enable inbound definition. 24. In the Disable field, select the desired option. Set up inbound definition - Text Set up inbound definition - Text Use inbound definitions when you receive EDI message files from the AS2 web app. Set up an inbound definition of type Text to move files with field and line separators (for example, CSV files) 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 FO the data must be imported. Example Text file content example: ORDER;10002;US-027;M0001;123.45;2025-03-01 Example of setup that can be applied to get the customer ID (US-027): Field Setting Record separator /r/n Field separator ; Identification (recipient) ORDER Field number (recipient) 2 Procedure 1. Click Connectivity studio EDI integration design. 2. Click Projects. 3. On the Action Pane, click Design. 4. Click Inbound definition. 5. Click New. 6. In the Sequence field, enter a number. 7. In the Name field, type a value. 8. In the Document type field, select 'Text'. 9. 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 Text files with order information, you can set the read filter to 'Order*.txt'. In the Read filter field, type a value. 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. In the Mandatory field, select the desired option. 12. Sub-task: Set up search definition. 13. Expand the Search definition section. 14. In the Record separator field, define the applicable record separator. Note: Usually, the record separator (/r/n) is not shown in the Text file. 15. In the Field separator field, define the applicable field separator. 16. In the Identification field, define the record identification for the field with the EDI message type identification. 17. In the Type field number field, enter the number of the field with the EDI message type information. 18. In the Identification field, define the record identification for the field with the recipient-related information. 19. In the Recipient field number field, enter the number of the field with the recipient-related information. 20. Sub-task: Set up file distribution definition. 21. Expand the Definition section. 22. Click New. 23. In the Type found field, type a value. 24. In the Receiver company field, enter or select a value. 25. 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: - 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. In the Message field, enter or select a value. 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. 26. Select the Rename file check box. 27. Sub-task: Enable inbound definition. 28. In the Disable field, select the desired option. Set up inbound definition - Fixed text Set up inbound definition - Fixed text Use inbound definitions when you receive EDI message files from the AS2 web app. Set up an inbound definition of type Fixed text to move files with defined start positions and lengths for fields 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 FO the data must be imported. Example Fixed text file content example: ORDER10002US-027M0001123.452025-03-01 Example of setup that can be applied to get the customer ID (US-027): Field Setting Record separator /r/n Identification (recipient) ORDER Start position (recipient) 11 Field length (recipient) 6 Procedure 1. Click Connectivity studio EDI integration design. 2. Click Projects. 3. On the Action Pane, click Design. 4. Click Inbound definition. 5. Click New. 6. In the Sequence field, enter a number. 7. In the Name field, type a value. 8. In the Document type field, select 'Fixed text'. 9. 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 Fixed text files with order information, you can set the read filter to 'Order*.txt'. In the Read filter field, type a value. 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. In the Mandatory field, select the desired option. 12. Sub-task: Set up search definition. 13. Expand the Search definition section. 14. In the Record separator field, define the applicable record separator. Note: Usually, the record separator (/r/n) is not shown in the Text file. 15. In the Identification field, define the record identification for the field with the EDI message type identification. 16. In the Type start position field, enter the position number where the EDI message type information starts. Note: The identification is included in the position numbering. 17. In the Type field length field, enter the number of positions of the EDI message type identification. 18. In the Identification field, define the record identification for the field with the recipient-related identification information. 19. In the Recipient start position field, enter the position number where the recipient-related information starts. Note: The identification is included in the position numbering. 20. In the Recipient field length field, enter the number of positions of the recipient-related identification. 21. Sub-task: Set up file distribution definition. 22. Expand the Definition section. 23. Click New. 24. In the Type found field, type a value. 25. In the Receiver company field, enter or select a value. 26. 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: - 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. In the Message field, enter or select a value. 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. 27. Select the Rename file check box. 28. Sub-task: Enable inbound definition. 29. In the Disable field, select the desired option. Set up inbound definition - EDI Set up inbound definition - EDI Use inbound definitions when you receive EDI message files from the AS2 web app. Set up an inbound definition of type EDI to move files that are structured in line with an EDI standard (for example, EDIFACT) 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 FO the data must be imported. Example EDI file content example: UNH+1+ORDERS:d:12A:EU:EAN123 Example of setup that can be applied to get the type (ORDERS): Field Setting Segment terminator ´/r/n Data element separator + Field separator : Identification (type) UNH Segment number (type) 2 Segment field (type) 1 Procedure 1. Click Connectivity studio EDI integration design. 2. Click Projects. 3. On the Action Pane, click Design. 4. Click Inbound definition. 5. Click New. 6. In the Sequence field, enter a number. 7. In the Name field, type a value. 8. In the Document type field, select 'EDI'. 9. 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 EDI files with order information, you can set the read filter to 'Order*.xml'. In the Read filter field, type a value. 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. In the Mandatory field, select the desired option. 12. Sub-task: Set up search definition. 13. Expand the Search definition section. 14. In the Segment terminator field, type a value. 15. In the Data element separator field, type a value. 16. In the Field separator field, type a value. 17. In the Identification field, define the EDI segment identification for the field with the EDI message type information. 18. In the Type segment number field, enter the number of the data element with the EDI message type information. 19. In the Segment field number field, enter the number of the field with the EDI message type information. Note: This is the number of the field within the data element, if the data element has several fields. 20. In the Identification field, define the EDI segment identification for the field field with the recipient-related information. 21. In the Type segment number field, enter the number of the data element with the recipient related information. 22. In the Segment field number field, enter the number of the field with the recipient-related information. Note: This is the number of the field within the data element, if the data element has several fields. 23. Sub-task: Set up file distribution definition. 24. Expand the Definition section. 25. Click New. 26. In the Type found field, type a value. 27. In the Receiver company field, enter or select a value. 28. 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: - 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. In the Message field, enter or select a value. 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. 29. Select the Rename file check box. 30. Sub-task: Enable inbound definition. 31. In the Disable field, select the desired option. Test inbound  definition setup? Test inbound  definition setup? Test AS2 inbound definition setup

Test AS2 inbound definition setup

If you have set up an inbound definition, you can test it.

To test an inbound definition, first make sure a test file is available in the Working folder as defined by the connector of the inbound definition.

End End Yes No

Activities

Name Responsible Description

Set up inbound definition - XML

Administrator

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 FO 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.

Set up inbound definition - JSON

Administrator

Use inbound definitions when you receive EDI message files from the AS2 web app.

Set up an inbound definition of type JSON to move files with data-object notation 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 FO the data must be imported.

Example

JSON file content example:

{"Stores":["Lambton Quay","Willis Street"],"Manufacturers":[{"Name":"Acme Co","Products":[{"Name":"Anvil","Price":50}]},{"Name":"Contoso","Products":[{"Name":"Elbow Grease","Price":99.95},{"Name":"Headlight Fluid","Price":4}]}]}

Examples of JSON path expressions that can be applied to this example:

  • Manufacturers[0].Name: Finds the name of the first manufacturer: Acme Co.
  • $..*[?(@.* == 'Acme Co')]: Finds the name of the token: Name.

Note: JSON path expressions are case sensitive.

Set up inbound definition - Text

Administrator

Use inbound definitions when you receive EDI message files from the AS2 web app.

Set up an inbound definition of type Text to move files with field and line separators (for example, CSV files) 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 FO the data must be imported.

Example

Text file content example:

ORDER;10002;US-027;M0001;123.45;2025-03-01

Example of setup that can be applied to get the customer ID (US-027):

Field Setting
Record separator /r/n
Field separator ;
Identification (recipient) ORDER
Field number (recipient) 2

Set up inbound definition - Fixed text

Administrator

Use inbound definitions when you receive EDI message files from the AS2 web app.

Set up an inbound definition of type Fixed text to move files with defined start positions and lengths for fields 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 FO the data must be imported.

Example

Fixed text file content example:

ORDER10002US-027M0001123.452025-03-01

Example of setup that can be applied to get the customer ID (US-027):

Field Setting
Record separator /r/n
Identification (recipient) ORDER
Start position (recipient) 11
Field length (recipient) 6

Set up inbound definition - EDI

Administrator

Use inbound definitions when you receive EDI message files from the AS2 web app.

Set up an inbound definition of type EDI to move files that are structured in line with an EDI standard (for example, EDIFACT) 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 FO the data must be imported.

Example

EDI file content example:

UNH+1+ORDERS:d:12A:EU:EAN123

Example of setup that can be applied to get the type (ORDERS):

Field Setting
Segment terminator ´/r/n
Data element separator +
Field separator :
Identification (type) UNH
Segment number (type) 2
Segment field (type) 1

Test AS2 inbound definition setup

Administrator

If you have set up an inbound definition, you can test it.

To test an inbound definition, first make sure a test file is available in the Working folder as defined by the connector of the inbound definition.

Test AS2 inbound definition setup

See also

Provide feedback