|  Developer
Updated on December 5, 2022

compareStrings

  • This event arises when the of an item/expression corresponds to a condition set in this block. The implements the same set of operators and works exactly the same way as the compareNumbers does.
  • When the data source is a device/item group, the event is stateless. It arises every time the condition is true, no matter which value of an event was previously. See Stateless comparison.
  • An or type can be used instead of a constant item value.
Edit
Field Type Required Description
blockOptions.method.args object + Declares arguments of a condition block. Every key in should correspond to a record in the array. The record in the array should have a property equal to the value of a parameter in the dictionary.
blockOptions.method.args.item
blockOptions.method.args.expression
string + Argument declaration of value source name. The value should be in block with name.
blockOptions.method.args.item string Value source for the left part of the comparison operator. References the item by its ID. The name of the source should have a corresponding block with a matching source name.
blockOptions.method.args.expression string Value source for the left part of the comparison operator. References an expression by its .
blockOptions.method.args.deviceGroup string Value source for the left part of the comparison operator. References a device group by its ID. The parameter is required.
blockOptions.method.args.itemGroup string Value source for the left part of the comparison operator. References an item group by its ID. The parameter is required.
blockOptions.method.args.value string + Argument declaration of a value to compare with. Could be a constant value or an expression reference or an item id. The value should be in block with name.
blockOptions.method.args.comparator string + Argument declaration of comparator state. The value should be in block with name. Possible comparators are , , , , , .
Edit
				
					"when" : [
    {
        "blockType":"when",
        "blockOptions":{
            "method":{
                "name":"compareStrings",
                "args":{
                    "item":"item",
                    "comparator":"comparator",
                    "value":"value"
                }
            }
        },
        "fields":[
            {
                "name":"item",
                "type":"item",
                "value":"5de64f6a70c7be0541cc0853"
            },
            {
                "name":"comparator",
                "type":"string",
                "value": ">"
            },
            {
                "name":"value",
                "type":"string",
                "value": "<value>"
            }
        ]
    }
]				
			

In a case of expression, the field should reference the existing expression by name:

				
					{
    "name":"value",
    "type":"expression",
    "value":"<expressionName>"
}