Dictionary

Dictionary is a system element, that stores data as a "key-value" pair or a "key-multiple values" set. Dictionary keys are unique.

Dictionaries are used to configure how values are displayed in widgets and properties.

Dictionaries are not designed to store large amount of data. Recommended dictionary size – no more than a 1000 entries. However, the system doesn’t have a hard limit on dictionary sizes.

You can configure dictionaries in the Dictionaries section of the system settings.

Named fields

Every value of the dictionary can be assigned a name. For example, the dictionary that stores the information about water meters could look like this:

named fields
Example of a dictionary with named fields

Named fields can be used when using dictionary values as variables. You can find out more in the Use property values as variables section.

You can assign names to fields only when importing a dictionary from an Excel file. In the current version of SAYMON UI you cannot rename columns.

To import named field, the table should have a format like this:

Name

Serial number

Commissioning

SDM630CT

MKL68JLASKH8

24.03.2021

EMLITE ECA2

GRY9RK635VQM

16.09.2023

SDM120CT

AA8RQPVD3JL8

03.11.2024

You can also create named fields via the REST API with Create dictionary and Update dictionary requests.

Encrypted fields

Fields in the dictionaries can be encrypted. To do this, field name must contain the word password (case insensitive). To change the value of encrypted fields, you must reenter its value in the corresponding field. These values can only be read and used on the server.

encrypted

Internally, encrypted fields look like this:

{
    "content": "{\"john.doe\":\"<<crypt:8D0E4E0C1EFC3D4533005804379270C8:96CB2385E0E693D391DD69A156088C46ACAEBEF2C7266993509723F7ECA7DE42>>\",\"jane.doe\":\"<<crypt:280B6896DECF67A730AC1AE011B254FF:0BF81AAF0B206712967008CA9BC9367C>>\"}",
}
To use encrypted field, you must enable encryption in the server configuration. Without this configuration, the values will not be encrypted, just hidden in the web interface.

Indexing fields

You can access dictionary fields the same way you would access elements of an array. This is used when changing how dictionary values are displayed in property classes and when substituting dictionary values ​​as variables in notification templates, monitoring parameters, state change conditions, and other places in the system.

Dictionaries use the following indexing:

Element index Value

0

Key

1 .. N

Dictionary values. N – number of entries in a dictionary.

N + 1, negative values

undefined.