The Dataset module offers powerful configuration options for managing queries efficiently. Users can define queries with custom names, select database configurations, and input SQL statements, including Tag embedding. Mapping options enable data population from query results, and users can specify time references (UTC or Local) for Date Time fields.
In addition, the Dataset module allows users to display query results using Data Grids in screens and dashboards, simplifying data visualization. Query results can also trigger actions in custom scripts and tags, enhancing automation capabilities for notifications and tag updates. For more advanced functionalities, users can explore Stored Procedures.
On this page:
To create and configure a Dataset Query, follow the steps below:
Enter a Name and Description for the Query
Click Ok.
The use of spaces is not allowed in the Name. Instead, use underscores. For example My_Query. |
You can modify the Query settings after its creation. Double-click the property you wish to edit on the row corresponding to the Query you want to modify. The following table lists all possible configuration properties.
Column | Description |
---|---|
Name | The Query's name. The system will warn you if you choose an invalid name. |
DB | Defines the database where the Query will be executed. |
SqlStatement | Specify the Query using SQL syntax. You can embed Tags directly on the SQL statement, embracing the tag with curly brackets. For example, ColumnName = {tag.tagInt}. Alternatively, you can update the SQL Statement with the Script module accessing the property Dataset.Query.QueryName.SqlStatement. If you access that property from multiple tasks using this approach, be aware of potential concurrency issues. For more information, access Advanced Dataset Guide. |
Mapping | Click the three dots button (...) to select the tags you want to populate with data from specific columns the Query returns. |
MappingDateTime | Specify how the time in Database will be interpreted (UTC or Local), when mapping to DateTimeOffset .NET variables. |
Description | Query's description. |
One of the critical features of the Dataset module is the ability to display Query results on screens and dashboards using visualization tools like Data Grids. To use Data Grids to display query results, follow these steps:
You can access the Displays (Desktop and Web) page for more information on configuring Displays.
You can use Query results to trigger actions in custom scripts and tags. To use this kind of automation, you need to follow the steps below:
Check the Stored Procedures page for additional information.