Params are the input data that must be received from the user, in order to complete an action. If we consider the execution of an action analogous to filling a form, then the fields in the form are considered as the params for the action.
For example, the params of the action "Create an event" would typically be "title", "start time", "end time" and so on.
You can add a new param to an action by clicking the option under the PARAMS section or option under the SET PARAM dialog (that would appear while marking params in sample sentences).
In the NEW PARAM pop-up, fill in the following information.
- Param Name - A valid param name should comply with the following points.
- It should begin with a lower case alphabet.
- No characters other than alphabets and numbers are allowed.
- It must be unique for an action.
- The following names cannot be used as a param, since they are reserved words in Zia - userInput, previousParam, additionalParams, sessionData, broadcast, previousUserMsgs, cache, org, and user.
- Param Type - Choose an apt data type for your param. The following data types are supported by Zia.
- String
- Integer Number
- Decimal Number
- Date
- Date Range
- Time
- Time Range
- Array - Single Selection — a list of available options from which the user can select only one.
- Array - Multiple Selection — a list of available options from which the user can select more than one.
- User
- Boolean — a YES or NO input
- Email
In case of array type params, you may have to enter the following additional information.
- Array values
These are the list of options from which the user can select either one or multiple choices. It is recommended to give every option value as distinct and understandable to the user. Every option also has an id, which are used to uniquely identify an option value programmatically. Either you can enter the id for every option manually or use the auto-generated id as you type in the values. - Mode of Input
It specifies the way in which an array param prompts the user. It can either be Textual or Visual. If Textual is chosen, the user will be able to type (in case of chat) or speak (in case of voice) the preferred value that they want to assign for the array param. In case of Visual mode of input, the user will have to click or touch to select their input from the array values, which would be displayed as a radio button (in case of single selection) or check box (in case of multiple selection).
- Prompt Message - It is the question that Zia would ask the user to get the input of the param value as a part of Zia’s conversation with the user. For example, to get the value of the param "starttime" in the "Create event" action, the prompt message shall be set as "At what time the event starts?" or "From when is the event?". Alternatively, you can override the prompt message of a param with the Context handler function. This field should not be left empty.
Reordering the params
The conversational flow of Zia depends on the order of the defined params. Once an action is detected, Zia will prompt all the params one by one with its respective prompt message in the order that they are defined. You can rearrange the params even after creating them, by just dragging and dropping an individual param at the desired position.
Note that, the users can give values to all these params in their natural language and Zia will convert the literal sentence into the apt value of the param as per the declared data type.