Assign Parameters in Conversations

The chatbot conversation can remember certain parameters that are set in the conversation. These can be set at various points to help make decisions at future points in the conversation. A classic example is setting parameter based on users selection.

For ex. if a user is asked a question "Please select the reason for contacting us today" and presented with options "Sales" and "Support", we can store their selection in a parameter for use in the rest of the conversation.

How to set a parameter?

  • Open the conversation flow and navigate to the node where you would like to set a parameter.

  • Click on the node and open the right panel

  • In the right panel scroll down to Additional Settings and click Edit next to Assign Parameters

  • In the popup you will be able to add parameters and save them at this node.

  • If a captured or declared parameter holds sensitive data such as an API Key, email etc. you should declare it under Sensitive Parameters to ensure it is scrubbed from the transcript.

  • Optionally the parameter can be declared as Encrypted

Note: Parameters are assigned after the node has been evaluated and are available for use from the subsequent steps

Types of Parameter Values

Fixed Values

Fixed parameter values can be used to set parameters for routing the conversation or using some conversation state available from the platform.

Parameter

Description

$sys_transcript

Allows you to store the transcript of the conversation till this point into the parameter

$sys_outgoing_transition

Allows you to capture the user selection in case of a Question node into a parameter

$a.b.c

Allows copying the nested parameter value from the conversation context. This is useful for api calls where the response might be a nested JSON.

<Any Text Value>

Saves the text value in the parameter and is available in the conversation till unset

Expression

Expressions allow to transform data and store the result in a parameter. The expressions are useful if you are looking to do operations such as math operations, string manipulation and certain built in functions that are provided through the platform.

Operators

Here is a list of operators that you use with the conversation parameters

+

add two things. x + y 1 + 1 -> 2 string concatenation firstName + ' ' + lastName -> dhruv arya

-

subtract two things x - y 100 - 1 -> 99

/

divide one thing by another x / y 100/10 -> 10

*

multiple one thing by another x * y 10 * 10 -> 100

**

'to the power of' x**y 2 ** 10 -> 1024

%

modulus. (remainder) x % y 15 % 4 -> 3

==

equals x == y 15 == 4 -> False

<

Less than. x < y 1 < 4 -> True

>

Greater than. x > y 1 > 4 -> False

<=

Less than or Equal to. x <= y 1 < 4 -> True

>=

Greater or Equal to x >= 21 1 >= 4 -> False

in

is something contained within something else. "spam" in "my breakfast" -> False

Utility Functions

In addition to the operators you can also use certain prebuilt utility functions.

DOUBLEConvert parameter to a floating point type

MD5

Generate the md5 hash of the parameter

INT

Convert parameter to a integer type

STR

Convert parameter to string type

SORT_LIST

Sort the list of values in ascending order

REVERSE_LIST

Reverse the list of values

APPEND_LIST

Sort the list of values

SUBSTITUTE

Substitute part of a string ex. SUBSTITUTE(param1, '-', '_')

FORMAT_DATE

FORMAT_DATE(param1, <date_format>) For referencing date format please visit https://www.strfti.me/

REGEX_EXTRACT

REGEX_EXTRACT(param1, <pattern>)

SPLIT_PART

SPLIT_PART(param1, ' ', 1) example: SPLIT_PART('Dhruv Arya', ' ', 1) will be equal to "Arya"

CURRENT_DATE_BETWEEN

CURRENT_DATE_BETWEEN(start_date_or_timestamp, end_date_or_timestamp)

How to unset a parameter value?

You can unset a parameter by choosing the Unset option and giving the parameter name or path you would like to unset.

You can use path notation as well ex. a.b.c

How to use parameters in messages?

Parameters can be used in our templating language by referring to them as follows:

Hello {{ firstName }}

Action Parameters

Action parameters are special purpose parameters that allow you to define actions to take during the flow execution. These are fixed value parameters with value serving as a property of the parameter.

You can set this like the image below:

Parameter

Value Type

Description

__action_delay

Number of Seconds to delay, maximum delay of 15 seconds is allowed

Allows you to delay going to the next node

Last updated