Defining Params

Defining Params

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.

  1. 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.
  2. 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. 
    1. 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.
    2. 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).

  3. 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.

    • Related Articles

    • Defining Sample Sentences

      Defining sample sentences is the key in defining your action, because this is what the user is likely to tell Zia in order to trigger your action.  If you have chosen the action intention as "Perform an Operation", then sample sentences must be ...
    • Defining an Action

      Adding a new Action To add a new action to a bot, follow the steps as given below.  In the bot's detail page, under the ACTIONS tab, click the + ADD ACTION option. The Create New Action page appears. Give a meaningful name for the action. Based on ...
    • Defining Deluge Functions

      Functions are custom hooks written by action developers that are invoked by Zia at various points during an action's execution. The conversational flow and the execution of an action are determined by the functions defined for that action.  The ...
    • Defining Business Hours and HolidaysDefining Business Hours and Holidays

      Customer support teams in an organization may follow their own business hours and work in shifts based on different time zones. The customer support personnel at the Japan office and the one in the Indian office will have different work schedules and ...
    • Context handler function

      Context handler function is used to control the conversational flow of an action. You can change the order in which the params are prompted to the users in the runtime. You can also skip some params, do custom validations of the param values and ask ...