Use a Microsoft Excel document to read data from or write data to a Microsoft Excel file (XLSX).


Application Consultant Application Consultant Start Start Set up document - Microsoft Excel Set up document - Microsoft Excel Use a Microsoft Excel document to read data from or write data to a Microsoft Excel file (XLSX). Procedure 1. Click Connectivity studio Integration Design. 2. Click the Documents tab. 3. Click New. 4. Define a meaningful name for the document. Example: If the document is used for a sales integration, you can use names like 'Sales - Order' or 'Sales - Invoice'. In the Document field, type a value. Note: Best practice: In the document name, do not use the: - Application: Use the Application field to define the applicable application. - Document type: Use the Document type field to define the applicable document type. 5. In the Project field, enter or select a value. 6. Define the applicable application for the document. For a Microsoft Excel document, for example, select a 'Windows folder' or 'Files' application. In the Application field, enter or select a value. Note: You can only select an application that is defined for the applicable project. You can define project applications on the Projects page. 7. In the Document types field, select 'Microsoft Excel'. 8. Sub-task: Set properties. 9. Expand the Properties section. 10. In the Process type field, select an option. 11. In the Template filename field, enter or select a value. 12. Sub-task: Set custom handler. 13. Expand the Custom section. 14. For a Microsoft Excel document, the standard handler class is 'BisDocumentExcel'. This handler class reads data from or writes data to Microsoft Excel files using Open XML. You can use a customized handler class. To do so, extend a standard handler class. In the Handler field, enter or select a value. Note: Select the 'BisDocumentExcelV3' handler, if you, on a message, use the XML document in combination with a connector of one of these types: - Web service - Blob storage - Upload and download - SharePoint 15. Sub-task: Set read options. 16. Expand the Read section. 17. In the Read filename field, type a value. 18. Select Yes in the Read only once field. 19. On running an applicable message, you can have a dialog shown with the data to be imported. You can review the data before it is actually imported. This can, for example, be useful when importing work breakdown structures, because you cannot easily undo the import. The dialog is only shown if you manually run the message. So, the dialog is not shown if you run the message in batch. Select Yes in the Validate input field. Note: If you use input validation, make sure the Process type is set to 'Query'. 20. In the Read start position field, type a value. 21. In the Read sheet name field, type a value. 22. Sub-task: Set write options. 23. Expand the Write section. 24. Using a variable, you can add the value of two table fields to the filename. If you want to do so, define the applicable table. On write, this document is the target document. However, the file name is defined based on the root record values of the source document. So, make sure you select a table and table fields from the root record of the applicable source document. In the Table name field, enter or select a value. Note: You cannot use the table name itself as variable in the filename. 25. Define the first table field which value you want to add to the file name. The related variable is '%5'. In the First field field, enter or select a value. Note: You can only select a field from the defined table. 26. Define the second table field which value you want to add to the file name. The related variable is '%6'. In the Second field field, enter or select a value. Note: You can only select a field from the defined table. 27. In the Number sequence field, enter or select a value. 28. In the Write filename field, type a value. 29. In the Write start position field, type a value. 30. In the Write sheet name field, type a value. 31. Sub-task: Set record layout options. 32. Expand the Record layout section. 33. Select Yes in the Use header field. 34. Select Yes in the Record identification field. 35. On import, you can split large Microsoft Excel files with a lot of records. To do so, define, the number of root records based on which the file is split. When the message is run, the original file is put in the Split folder instead of the Working folder, as defined on the applicable connector. The original file is split in smaller files based on the split quantity. The smaller split files are put in the Working folder. The message processes the split files in parallel from the working folder. In the Split quantity field, enter a number. Note: Only use the split functionality for simple (one record level) data. It is not suitable for data with multiple levels (header and line records). 36. Sub-task: Define document properties. 37. Expand the Document properties section. 38. Click Read properties. 39. Click New. 40. In the Name field, type a value. 41. In the Type field, select an option. 42. In the Value field, type a value. 43. In the Field name field, enter or select a value. 44. Click Write properties. 45. Close the page. Notes Files with the extension '.xls' are not supported because these do not support Office Open XML.If you need to export a lot of data (40.000 records or more), consider to use the SQL server exports to Microsoft Excel. Add document records - Microsoft Excel Add document records - Microsoft Excel To each document, add the data records to be exchanged. For external file-based documents, set up the records in line with how the data is structured and named in the file.This topic explains how to add records to a Microsoft Excel document. Procedure 1. Click Connectivity studio Integration Design. 2. Click the Documents tab. 3. In the list, find and select the desired Microsoft Excel document. 4. Click Edit. 5. In the Record section, click Add line. 6. In the Record field, type a value. 7. In the Record table field, keep the default value 'BisBufferTable'. 8. In the Parent record field, enter or select a value. 9. Select Yes in the Combine with parent record field. 10. In the Join mode field, select an option. 11. Select Yes in the History field. Notes Generic external document record details fields:External reference: You can indicate which field of the record contains the unique ID of the record in the external database. In this way, you link the external ID to the D365 FO record ID. Note: Usually, you only use this for an ODBC connection with CRM or if you use web services.Revision field: 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. Note: You can only use this field in combination with the External reference field. Manage document record setup - External documents

Manage document record setup - External documents

You have several options to manage the document record setup for external file-based documents.

You can:
  • Change the sequence of the records.
  • View where a record is used.
  • Validate the record setup.

Initialize document record fields Initialize document record fields For documents of type Text or Microsoft Excel, you can initialize the fields for a record. To initialize record fields for: A Text document, use a connector of type Azure file storage and an input file of type TXT. The fields are initialized based on the header-line setup in the TXT file. A Microsoft Excel document, use a connector of type Azure file storage and an input file of type XLSX. The fields are initialized based on the header-line setup in the XLSX file. When the initialization is finished, review and complete the properties of the initialized fields. Usually, during review, you do not add fields. However, you can remove the not needed fields. Procedure 1. Click Connectivity studio Integration Design. 2. Click the Documents tab. 3. In the list, find and select the desired document of type Text or Microsoft Excel. 4. Click Edit. 5. In the Records section, in the Record list, find and select the desired record. 6. Click Initialize. 7. On the dialog, in the Connector field, enter or select a value. 8. In the File name field, enter or select a value. 9. Click OK. 10. Close the page. Select fields Select fields You can add a selection of table fields to a record. You can select fields from the D365 FO table that is defined in the Record table field.This is mainly applicable to internal documents. However, you can also use this to quickly set up fields for external file-based documents.When the field selection is added to the record, review and complete the properties of the added fields. Procedure 1. Click Connectivity studio Integration Design. 2. Click the Documents tab. 3. In the list, find and select the desired document. 4. Click Edit. 5. In the Records section, in the Record list, find and select the desired record. 6. Click Select fields. 7. Sub-task: Define filter. 8. In the Table name field, enter or select a value. 9. Select Yes in the Show system fields field. 10. Select No in the Show inherited fields field. 11. Usually, you add fields to an internal document record with the type as defined in the table setup. However, you can add all selected fields with the type set to String. Select Yes in the Create as string fields field. Note: This field is only available for internal documents. 12. Sub-task: Select fields. 13. Click Select the fields of a specific group to open the drop dialog. 14. In the Field group name field, enter or select a value. 15. Click OK. 16. Click Select all. 17. Click Deselect all fields. 18. Click Select mandatory. 19. Select the Selected check box for the desired fields. 20. Click OK. Copy fields Copy fields You can copy fields from a record of another document. You can use this, for example, to save setup time if you use a specific record in several documents.You can only copy fields:From a record with the Record table defined.To a record with no fields.As a result, the full field setup is copied from the selected record to the current record. Procedure 1. Click Connectivity studio Integration Design. 2. Click the Documents tab. 3. In the list, find and select the desired document. 4. Click Edit. 5. In the Record section, in the Record list, find and select the desired record. 6. Click Copy fields. 7. In the Record field, select the desired record from another document. Note: You can only select a record with the same Record table defined as the current record. 8. Click OK. 9. Close the page. Add document record fields - Microsoft Excel Add document record fields - Microsoft Excel 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 Microsoft Excel documents, fields can be of any type.This topic explains how to add record fields to a Microsoft Excel document.If fields are already initialized for, selected for, or copied to the record, you can review and complete the setup for these fields. To do so, skip step 6. Procedure 1. Click Connectivity studio Integration Design. 2. Click the Documents tab. 3. In the list, find and select the desired Microsoft Excel document. 4. Click Edit. 5. In the Records section, in the Record list, find and select the desired record. 6. 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: 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: The value of this field cannot have spaces. 9. Select the Key field check box. 10. 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, you will use value characters. 12. Define the data type of the value to be read from or written to Microsoft Excel to correctly import or export data the data. In the Type field, select an option. Note: In Microsoft Excel, you can use formulas to calculate the value of a field. Also calculated values can be read from a Microsoft Excel file. 13. Sub-task: Set external references for record. 14. 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: Usually, you only use this for an ODBC connection with CRM or if you use web services. 15. 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: You can only use this field in combination with the External reference field. 16. Close the page. Manage document record field setup

Manage document record field setup - Internal documents

You have several options to manage the document record field setup for internal documents.
You can:

  • Change the sequence of the fields.
  • View where a field is used.
  • Clean up unused fields.
  • Create a related record.

Validate connectivity setup

Validate connectivity setup

If you open a form or save (changes to) the setup of a key element in Connectivity studio, the setup is validated automatically. If errors are found in the setup, an error icon   is shown. You can click the icon to show the related error messages.

You can also manually start an automated test to check for errors in the setup. As a result, the found errors are shown. Also, the error icons are shown where applicable.
When errors are found, you can try to fix these errors automatically.
You can check and auto-fix errors for these key elements in Connectivity studio:
Key element Check
Projects When automatically checked, only the project setup is checked, and not the related setup like messages and connectors. When started manually, the full project setup is checked.
Documents The document setup is checked, including the document records setup.
Document records Only the document records setup is checked.
Messages The message setup is checked, including the data synchronization setup and message mapping.
Message - Data synchronization setup Only the data synchronization setup is checked.
Message mapping Only the message mapping is checked.
Message business events A check is done if a business event is created for the message business event. Also, a check is done if the target fields and source fields match with the related document setup.
Connectors Only the connector setup is checked.
Web services The web service setup is checked, including the data synchronization setup.
Web service - Data synchronization setup Only the data synchronization setup is checked.

In this flow, in the activity steps, as an example, the validation is done for documents.

End End

Activities

Name Responsible Description

Set up document - Microsoft Excel

Application Consultant

Use a Microsoft Excel document to read data from or write data to a Microsoft Excel file (XLSX).

Add document records - Microsoft Excel

Application Consultant

To each document, add the data records to be exchanged. For external file-based documents, set up the records in line with how the data is structured and named in the file.

This topic explains how to add records to a Microsoft Excel document.

Manage document record setup - External documents

Application Consultant

You have several options to manage the document record setup for external file-based documents.
You can:
  • Change the sequence of the records.
  • View where a record is used.
  • Validate the record setup.

Initialize document record fields

Application Consultant

For documents of type Text or Microsoft Excel, you can initialize the fields for a record. To initialize record fields for:

  • A Text document, use a connector of type Azure file storage and an input file of type TXT. The fields are initialized based on the header-line setup in the TXT file.
  • A Microsoft Excel document, use a connector of type Azure file storage and an input file of type XLSX. The fields are initialized based on the header-line setup in the XLSX file.

When the initialization is finished, review and complete the properties of the initialized fields. Usually, during review, you do not add fields. However, you can remove the not needed fields.

Select fields

Application Consultant

You can add a selection of table fields to a record. You can select fields from the D365 FO table that is defined in the Record table field.

This is mainly applicable to internal documents. However, you can also use this to quickly set up fields for external file-based documents.

When the field selection is added to the record, review and complete the properties of the added fields.

Copy fields

Application Consultant

You can copy fields from a record of another document. You can use this, for example, to save setup time if you use a specific record in several documents.
You can only copy fields:
  • From a record with the Record table defined.
  • To a record with no fields.
As a result, the full field setup is copied from the selected record to the current record.

Add document record fields - Microsoft Excel

Application Consultant

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 Microsoft Excel documents, fields can be of any type.
This topic explains how to add record fields to a Microsoft Excel document.
If fields are already initialized for, selected for, or copied to the record, you can review and complete the setup for these fields. To do so, skip step 6.

Manage document record field setup

Application Consultant

You have several options to manage the document record field setup for internal documents.
You can:
  • Change the sequence of the fields.
  • View where a field is used.
  • Clean up unused fields.
  • Create a related record.

Validate connectivity setup

Application Consultant

If you open a form or save (changes to) the setup of a key element in Connectivity studio, the setup is validated automatically. If errors are found in the setup, an error icon   is shown. You can click the icon to show the related error messages.

You can also manually start an automated test to check for errors in the setup. As a result, the found errors are shown. Also, the error icons are shown where applicable.
When errors are found, you can try to fix these errors automatically.
You can check and auto-fix errors for these key elements in Connectivity studio:
Key element Check
Projects When automatically checked, only the project setup is checked, and not the related setup like messages and connectors. When started manually, the full project setup is checked.
Documents The document setup is checked, including the document records setup.
Document records Only the document records setup is checked.
Messages The message setup is checked, including the data synchronization setup and message mapping.
Message - Data synchronization setup Only the data synchronization setup is checked.
Message mapping Only the message mapping is checked.
Message business events A check is done if a business event is created for the message business event. Also, a check is done if the target fields and source fields match with the related document setup.
Connectors Only the connector setup is checked.
Web services The web service setup is checked, including the data synchronization setup.
Web service - Data synchronization setup Only the data synchronization setup is checked.

In this flow, in the activity steps, as an example, the validation is done for documents.

Provide feedback