<< 点击显示目录 >> 主页 mappView帮助助手 > mapp View帮助信息 > Widgets > Data > AlarmHistory > Concept > Filter configuration |
This section explains the composition of string filterConfiguration.
"[{"value":85,"conditionType":"==","columnType":"ins"}]"
When creating filter criteria, the string contains 3 components: The value, the condition type and the column types.
•value:
Defines the value that is compared. If it is a "string", the value must be enclosed in quotation marks (" "). If it is a "number", the value should not be enclosed in quotation marks.
•conditionType
conditionType specifies the comparison operations with which the filter is performed.
The following values are available for this: "<>", "==", "<", "<=", "=>", ">", "Contains", "Does not contain".
Values "Contains" and "Does not contain" work with string comparison. It must thus be ensured that a string binding is used.
•columnType
columnType specifies the column type that should be used in the filter. Each column type has a short form and a certain data type shown in the following list.
•additionalInfo1 - ad1 - string
•additionalInfo2 - ad2 - string
•category - cat - integer
•code - cod - integer
•instanceId - ins - integer
•message - mes - string
•name - nam - string
•scope - sco - string
•severity - sev - integer
•new state - stn - integer
•old state - sto - integer
•timestamp - tim - date
"[{"logicalOperator":"and","value":85,"conditionType":"==","columnType":"ins"},{"value":"2020-09-14T15:50:16.000Z","conditionType":"<","columnType":"tim"}]"
This extended filter consists of two elements.
When using multiple criteria, logicalOperator must be applied.
This combines the criteria with each other. An AND or OR operator can be used for this.
The last element does not contain a logical operator and looks like a single element.
This means that if additional elements should be added, they must each contain one logicalOperator per entry. Thus, only the last element does not contain a logicalOperator.
The following example includes multiple logical operators:
"[{"logicalOperator":"and","value":85,"conditionType":"==","columnType":"ins"},{"logicalOperator":"or","value":"2020-09-14T15:50:16.000Z","conditionType":"<","columnType":"tim"},{"value":"test","conditionType":"<>","columnType":"mes"}]"
If a date or time should be compared, ISO standard 8601 must be observed.
The t separates the date from the time and the z at the end indicates UTC. The time should still be specified in local time and not converted to UTC, however.
The local time must be selected and a z added at the end.
For Hanoi time zone (GMT +7), the current time 20202-09-10T14: 18: 01,000 is used and only a z is added, for example. The time zone is left out.
Example: 20202-09-10T14:18:01.000Z
The finished filter criteria is a JSON string. Whether the specified filter is correct can be checked on the following website:JSON string validation
If it appears green, it means that the JSON string is okay. If it appears red, this filter will not work in the widget.
Attention: Only double quotation marks should be used.