Skip to main content

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:

FieldDescription
CodeUnique identifier of the template.
DescriptionDescription of the template.
TypeChoose the template type: Mapping or Record Filter. To export information according to a specific data mapping, choose Mapping type.
Source Table IDID of the main table.
Source Table NameName 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)

FieldDescription
CodeUnique code for the variable table.
DescriptionDescription of the table.
Table IDID of the table in Business Central.
Table NameName of the table (auto-filled).
Is RootMarks the main table (auto-filled).
RepeatingIf checked, the table is repeating (line-based).
Parent Data CodeCode of the parent table used to retrieve related records.
Request Additional FiltersIf checked, a filter request page will appear during report generation.
LatestIf 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:

FieldDescription
Field IDID of the field to filter by.
Field CaptionField name (auto-filled).
TypeFilter 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 ValueFor entries with type = Filter, specify the value or expression.
Linked Field IDFor entries with type = Linked Field, specify the linking field.
Linked Field NameName 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)

FieldDescription
CodeUnique code for the mapped variable.
DescriptionDescription of the mapping.
RepeatingIf checked, this mapping is for a repeating table.
Repeating Data TableCode 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:

FieldDescription
OperationType 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.
TypeExpression type (Constant, Field, Data). Use Field to reference a table field; Constant for static values.
Const ValueSpecify the constant value if Type is Constant.
Linked Table DataCode of the table from which to retrieve data.
Table NameName of the related table.
Field IDField ID in the related table.
Field CaptionField name in the related table (auto-filled).
Transformation RuleUse if the output value needs to be converted to another format.

6. Usage Scenarios

Scenario 1: Document Data Export

  1. Create a template for a document (e.g., Sales Invoice).
  2. Add the document’s main table and its line table as repeating.
  3. Set up filters to link lines with the header.
  4. Define mapping codes for header and line fields.
  5. Add expressions for calculating values (e.g., field concatenation, conditions).

Scenario 2: Data Integration

  1. Create a template for integration.
  2. Add all necessary tables (e.g., Customer, Sales Header, Sales Line).
  3. Use filters to select required records.
  4. Define mapping codes for integration fields.
  5. Use expressions to transform the data.

Scenario 3: Custom Reporting

  1. Create a template for a report.
  2. Add tables and configure their relationships.
  3. Define mapping codes for report columns.
  4. Use expressions for calculated columns (e.g., totals, conditional values).
© 2008 - 2023 SMART business