Scenario: "SMART Data Template"
Extension - SMART Data Template
The SMART Data Template extension is an add-on for Microsoft Dynamics 365 Business Central that allows flexible configuration of data mapping and transformation. The extension enables the creation of templates with multiple tables, mappings, and expressions for automating integration, reporting, and data export — without code changes.
Key Features:
- Definition of data templates with any number of tables (as variables).
- Configuration of mapping codes and expressions for value calculation.
- Support for both single and repeating (line-based) structures.
- Flexible setup of filters and relationships between tables.
- Automation of export, integration, and reporting.
SMART Data Template allows you to configure complex data selection and transformation logic through the user interface. You define which tables to use, how they are related, what data to extract, and how to calculate or transform it — without writing code.
- Templates group all settings for a scenario.
- Tables serve as variables and context for data selection.
- Mappings define which data to output.
- Expressions describe how to calculate each mapping.
- Filters control which records to include and how tables are related.
This approach enables business users and consultants to automate data flows, reporting, and integrations flexibly and efficiently.
To use a data template, the following configuration steps must be performed.
1. Creating a Data Template
Page: Data Templates
You need to create a new data template by filling in the following fields:
Field | Description |
---|---|
Code | Unique identifier of the template. |
Description | Description of the template. |
Type | Choose the template type: Mapping or Record Filter. To export information according to a specific data mapping, choose Mapping type. |
Source Table ID | ID of the main table. |
Source Table Name | Name of the main table (auto-filled). |
2. Adding Tables to the Template
For the selected template, you must add tables that will be used as variables (contexts) in the data template.
Page: Data Template Tables (click the Data Tables button on the Data Templates page)
Field | Description |
---|---|
Code | Unique code for the variable table. |
Description | Description of the table. |
Table ID | ID of the table in Business Central. |
Table Name | Name of the table (auto-filled). |
Is Root | Marks the main table (auto-filled). |
Repeating | If checked, the table is repeating (line-based). |
Parent Data Code | Code of the parent table used to retrieve related records. |
Request Additional Filters | If checked, a filter request page will appear during report generation. |
Latest | If multiple records match the filters, setting this to Yes will return the latest record in the report. |
3. Configuring Table Filters
Define filters for each table to limit or link data. To set filters, on the Data Template Tables page, for the relevant table, go to the Filtered field and fill in the required filters:
Field | Description |
---|---|
Field ID | ID of the field to filter by. |
Field Caption | Field name (auto-filled). |
Type | Filter type: Filter or Linked Field. Use Filter to filter records in the current table. Use Linked Field to relate data to the parent table. |
Filter Value | For entries with type = Filter, specify the value or expression. |
Linked Field ID | For entries with type = Linked Field, specify the linking field. |
Linked Field Name | Name of the Linked field (auto-filled). |
Note: The values in the Filter Value field must be entered in the language of the interface from which the report will be run. For example, if the report is executed from the Ukrainian-language interface, all filter values must be specified in Ukrainian.
4. Adding Mapping Codes
Mapping codes are used for variables when generating the report or proceeding the integration.
Page: Data Template Mapping (click the Mapping Data Codes button on the Data Templates page)
Field | Description |
---|---|
Code | Unique code for the mapped variable. |
Description | Description of the mapping. |
Repeating | If checked, this mapping is for a repeating table. |
Repeating Data Table | Code of the repeating table. |
5. Adding Expressions
Each data mapping code must have one or more expressions. Expressions define what data will be output in the report. To add expressions, on the Data Template Mapping page, go to the Expression field of the corresponding mapping code and enter the needed expressions:
Field | Description |
---|---|
Operation | Type of operation (Concat, +, -, *, /, If empty, etc.). Use Concat to retrieve a field value. Use arithmetic operators for calculations. Use If empty to check for empty values and provide a fallback. Use If not empty to check for non-empty values. |
Type | Expression type (Constant, Field, Data). Use Field to reference a table field; Constant for static values. |
Const Value | Specify the constant value if Type is Constant. |
Linked Table Data | Code of the table from which to retrieve data. |
Table Name | Name of the related table. |
Field ID | Field ID in the related table. |
Field Caption | Field name in the related table (auto-filled). |
Transformation Rule | Use if the output value needs to be converted to another format. |
6. Usage Scenarios
Scenario 1: Document Data Export
- Create a template for a document (e.g., Sales Invoice).
- Add the document’s main table and its line table as repeating.
- Set up filters to link lines with the header.
- Define mapping codes for header and line fields.
- Add expressions for calculating values (e.g., field concatenation, conditions).
Scenario 2: Data Integration
- Create a template for integration.
- Add all necessary tables (e.g., Customer, Sales Header, Sales Line).
- Use filters to select required records.
- Define mapping codes for integration fields.
- Use expressions to transform the data.
Scenario 3: Custom Reporting
- Create a template for a report.
- Add tables and configure their relationships.
- Define mapping codes for report columns.
- Use expressions for calculated columns (e.g., totals, conditional values).