Tokens automatically include curly brackets in the script. For this reason, you don’t need to wrap the CognigyScript in the Script field or the Tokens in text fields with curly brackets.
Restrictions
- Only Node text fields with the
icon support Tokens.
Working with Tokens
In Manage > Tokens, you can view, create, and delete Tokens as well as copy their Reference ID. Tokens include the following information:- Name — the Token name displayed in Nodes and the Token Management Menu.
- Script — the CognigyScript expression used to access the data. You don’t need to wrap the CognigyScript expression in
{{ }}. - Type — the category of the Token in the search list:
- Input — access to the data in the Input object.
- Context — access to the data in the Context object.
- Profile — access to the data in the Profile object.
- Custom — specific CognigyScript expression with access to the data in one or more Cognigy objects. For example,
"Should your order " + context.customerOrderAmount + " be sent to " + profile.address + "?".
Deleting a Token doesn’t remove the CognigyScript from the Nodes that used the deleted Token.
Default Tokens
Cognigy provides a selection of default tokens that you can readily use in your Flows.Default Tokens
Default Tokens
Create and Use Tokens in the Node Editor
By clickingCreate Tokens from JSON Editors
To create a Token from a JSON editor, right-click a CognigyScript expression and select Create Token from JSON Path. The selected CognigyScript expression is added to the Script field. If you highlight any code snippet and create a Token from the JSON path, the highlighted code is added to the Name field.Example
The default Token named Text represents{{input.text}}. The following image shows the Text Token in a Node and the corresponding CognigyScript expression after it:
