Data selection parameters
- Last UpdatedNov 12, 2025
- 4 minute read
- PI System
- Adapter for MQTT 1.4
- Adapters
The following parameters are available for configuring a data selection:
|
Parameter |
Required |
Type |
Description |
|---|---|---|---|
|
topic |
Required |
string |
The MQTT topic string. It cannot be null, empty, or whitespace. |
|
valueField |
Required |
string |
The JSONPath expression used to extract the data value from a property within the payload supplied by the MQTT server. A valid JSONPath expression starts with $.1 This parameter cannot be null, empty, or whitespace. For more information about JSONPath expression syntax, see JSONPath syntax for value retrieval. |
|
dataFields |
Required |
dictionary |
A dictionary of values with key-value pairs. The keys are specific fields for a complex type and the values are the JSONPath expression used to extract the data value from a property within the payload supplied by the MQTT server. A valid JSONPath expression starts with $.1 Allowed keys: Latitude, Longitude, x, y, z. For more information about JSONPath expression syntax, see JSONPath syntax for value retrieval. |
|
indexField |
Optional |
string |
The JSONPath expression to take value to use as a timestamp from a property. A valid JSONPath expression starts with $.1 For more information about JSONPath expression syntax, see JSONPath syntax for value retrieval. Note: The adapter generates a timestamp when null is specified. Allowed value: Any valid JSONPath expression |
|
dataType |
Required |
string |
The expected data type of the values for the specified field. Input MQTT data types are: Int16, Int32, Int64, UInt16, UInt32, UInt64, Float32, Float64, Boolean, String, Date-Time Input MQTT complex data types are: Geolocation and Coordinates. For more information, see Principles of operation. |
|
uom |
Optional |
string |
A Unit of Measurement (UoM) is a reference point for measuring and comparing data, such as temperature or voltage. The unit of measure value from a property within the payload supplied by the MQTT broker. Allowed value: Any string |
|
indexFormat |
Optional |
string |
The time format of the timestamp value specified in the indexField property.2 The time format must be specified as yyyy-MM-ddTHH:mm:ss. Allowed value: Any string that can be used as a DateTime format in the .NET DateTime.TryParseExact()method, for example, 01/30/2021. For more information, see DateTime.TryParseExact Method Note: If the string cannot be parsed, specify a custom DateTime string or one of the following keywords: Adapter, UnixTimeSeconds, UnixTimeMilliseconds Default value: null |
|
selected |
Optional |
boolean |
Selects or clears a measurement. To select an item, set to true. To remove an item, leave the field empty or set to false. Allowed value: true or false |
|
name |
Optional |
string |
The optional friendly name of the data item collected from the data source. Allowed value: Any string |
|
streamId |
Optional |
string |
The custom stream Id that is used to create the streams. If you do not specify the StreamId, the adapter generates a default stream Id based on the data source parameter. For more information, see Data source. A properly configured custom stream Id follows these rules:
|
|
dataFilterId |
Optional |
string |
The identification of the data filter. Allowed value: Any string Note: If the specified dataFilterId does not exist, unfiltered data is sent until that dataFilterId is created. |
1 valueField and dataFields are mutually exclusive. For example, if you specify valueField, you cannot specify dataFields and vice versa.
2 If you do not specify indexField and indexFormat, the adapter automatically sets the latter to Adapter, which uses an adapter-supplied timestamp for the data. The timestamp is taken after the data is published to the adapter while the adapter processes it. If you specify indexFormat only with a value other than Adapter, the validation fails and the adapter throws an error.
CSV export/import with complex types
EdgeCmd utility supports the export and import of data selection with complex types, such as Geolocation and Coordinates. For example, the following command writes the data selection contents to a CSV file:
edgecmd get DataSelection -cid MQTT1 -file <fileName>.csv -csv
After the CSV file is created, you can use type <fileName>.csv to display the contents of the file. The output will look similar to the following example in which the keywords are in the first line and the values, including complex types, are in the second line:
topic,valueField,dataFields,indexField,dataType,indexFormat,selected,name,streamId,dataFilterId mqtt/Boilers/Boiler1,,"{""X"":"".xValue]"",""Y"":""$.yValue"",""Z"":""$.zValue""}",$['Timestamp'],Coordinates,,True,,mqtt/Boilers/Boiler1.$.xValue.$.yValue.$.zValue,
Runtime changes
When you create a new data selection item with a new topic property, the adapter automatically subscribes the topic to the data source and starts data collection for the stream associated with the data selection item. When you delete a data selection item, the adapter automatically stops collecting data for that item. Additionally, when you update a data selection item, the adapter updates the stream and continues data collection.
Note: Runtime changes also handle validation of configuration, which means that an invalid data selection configuration is rejected.