How to get client variable values
get_client_var() | get_client_vars()
To get the value of a single variable
get_client_var(client_id, variable)
Parameters:\ ! client_id - client ID\ ! variable - variable name
To get the values of multiple variables
get_client_vars(client_id, names)
Parameters:\ ! client_id - client ID\ ! names- array of variables
Let's send the manager a message with the lesson number that one of the participants in our project is taking:


The same option, but with output, for example, of the level and the lesson within it:


/*Getting a single variable*/
trial=get_client_var(64732310, 'lesson')
/*Getting multiple variables*/
names=["level","lesson"]
trial=get_client_vars(64732310, names)
How to assign a client variable
set_client_var() | set_client_vars()
To assign a single variable value
set_client_var(client_id, variable, value)
Parameters:
client_id — MaviBot client ID
variable — a name of the variable to be assigned
value — the variable value
To assign multiple variables
set_client_vars(client_id, variables_dict)
Parameters:
client_id — MaviBot client ID
variables_dict — dictionary; contains all variable names and their values to be added.
Format:
'{"var_name1": "var_value1", "var_name2": "var_value2", "var_name3": "var_value3"}'
Example 1:
set_client_var(client_id, "new", "yes")


Example 2:
set_client_vars(1136, '{"var_name1": "var_value1", "var_name2": "var_value2", "var_name3": "var_value3"}')

Variables section in the client card
