|  Developer
Updated on December 2, 2022

stringOperation

  • Fulfils selected operation on a string.
  • This feature is available since the version. The scene is triggered when the condition of the specified operation is satisfied.
  • operation checks if the item’s value begins with string specified in the parameter.
  • operation checks if the item’s value ends with string specified in the parameter.
  • operation check if the item’s value contains string specified in the parameter.
  • operation checks if the length of the item’s value is equal to the number specified in the parameter.
  • operation checks if the item’s value does not begin with string specified in the parameter.
  • operation checks if the item’s value does not end with string specified in the parameter.
  • operation checks if the item’s value does not contain string specified in the parameter.
  • operation checks if the length of the item’s value is NOT equal to the number specified in the parameter.
Edit
FieldTypeRequiredDescription
blockOptions.method.args.item
blockOptions.method.args.expression
item
expression
+Id of an item/expression whose value will be used as an operand for the string operation.
blockOptions.method.args.operationstring+Operation, which will be fulfilled. Possible values: , , , , , , , .
blockOptions.method.args.valueint/string+Argument of the string operation. for and operations, – for all other cases.
Edit
Internal error code Message Data
SCENE_WRONG_WHEN_BLOCK stringOperation: empty id of an item ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK stringOperation: “operation” field is empty ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK stringOperation: “value” field is empty ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK stringOperation: cannot create valid value: [REASON] ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK stringOperation: unknown operation: [OPERATION] ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK stringOperation: “[length/not_length]” operation requires operand to be a number ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK stringOperation: “[begin/end/contain/not_begin/not_end/not_contain]” operation requires operand to be a non-empty string ezlo.scenes.block.when.wrong
Edit
				
					{
    "blockType": "when",
    "blockOptions": {
        "method": {
            "name": "stringOperation",
            "args": {
                "item": "item",
                "operation": "operation",
                "value": "value"
            }
        }
    },
    "fields": [
        {
            "name": "item",
            "type": "item",
            "value": "5de64f6a70c7be0541cc0853"
        },
        {
            "name": "operation",
            "type": "string",
            "value": "contain"
        },
        {
            "name": "value",
            "type": "string",
            "value": "operateOnThis"
        }
    ]
}