substringValue
This action substrings a value to the specified limit (or the closest preceding whitespace). Then it copies the result to either the optional destination
field, or overwrites the source field.
Note
The limit character is not included in the substring i.e. a limit of 100 will not include the 100th character.
This function is available as a feature of the Add-ons v2.3.5 download and later.
This function is available for event, alert, and Situation workflows.
Back to Workflow Engine Functions Reference.
Arguments
Workflow Engine function substringValue
takes the following arguments:
Name | Required | Type | Description |
---|---|---|---|
source | yes | string | Source field name to substring |
destination | no | string | The destination field to write the substring to. If left blank the source will be used. |
limit | yes | number | The length of the substring. |
Example
Given a description being presented as a hex string:
"description" : "This is a string, it's too long to use""description": "54_68_69_73_20_69_73_20_61_20_74_65_73_74",
An event workflow could include a substringValue action::
Action - convertHexToAscii
source =
description
destination = [blank -- to be updated]
limit =
15
In the UI this would appear as:
{"source":"description","limit":15}
The action would substring the description to the closest whitespace to the 15th character and would write this back over the description, breaking the string on the closes available whitespace.
"description" : "This is a"