Bot Asks Offering List of Options

The bot offers a list of options for the user to choose from.

Starting from IBM RPA 23.0.3, support for Interactive Voice Response (IVR) is removed from this command due to the removal of IVR. For more information, see Removed.

Command availability: IBM RPA SaaS and IBM RPA on premises

Description

The bot offers a list of options for the user to choose from. It recognizes the selected option, or its index in the list, or a word that is similar enough to one of the options.

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

botAskList --names(ICollection<String>) [--descriptions(ICollection<String>)] [--retry(Boolean)] [--attempts(Numeric)] [--retrytext(String)] [--timeoutsub(String)] [--recognitionTimeout(TimeSpan)] [--speechCompleteTimeout(TimeSpan)] [--noInputTimeout(TimeSpan)] [--speechIncompleteTimeout(TimeSpan)] [--confidenceThreshold(Numeric)] [--beep(Boolean)] [--language(Language)] --text(String) [--textformat(String)] [--timeout(TimeSpan)] (String)=value (String)=utterance (Boolean)=timedout (Boolean)=success (String)=botHistoryMessageId

Dependencies

  • You must start a Chatbot or IVR instance by using the Connect to Chatbot (botConnect) command.
  • This command must be in the Connect to Chatbot scope.

Input parameters

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
Names names Required ICollection<Text> Name of the option provided by the Descriptions parameter.

You must enter names in the list in the same order as the option descriptions.
Descriptions descriptions Optional ICollection<Text> Description of each option that is available to the user.
Retry retry Optional Boolean Enable to allow the bot to ask a new question if there is no answer on the first attempt.
Attempts attempts Optional Number Number of times the question of Retry text is repeated.
Retry text retrytext Optional Text Alternative question that is asked to the user if there is no answer on the first attempt.
Subroutine timeoutsub Optional Text Subroutine to run if user response time runs out.
Maximum recognition time recognitionTimeout Optional Time Span Timeout to acknowledge the user's response
Maximum silence time after speech speechCompleteTimeout Optional Time Span Maximum time allowed without interaction with the bot after its last speech.

Starting from IBM RPA 23.0.3, this parameter is removed.
Waiting time noInputTimeout Optional Time Span Maximum waiting time for the user to start the conversation.

Starting from IBM RPA 23.0.3, this parameter is removed.
Maximum time of incomplete speech speechIncompleteTimeout Optional Time Span Maximum amount of time to wait for the user to complete the speech.

Starting from IBM RPA 23.0.3, this parameter is removed.
Confidence confidenceThreshold Optional Number Numeric expression that indicates the confidence level for recognizing user response.

Confidence rate is in the range 1 - 100. If the obtained value is lower than the specified range, it returns null.

Starting from IBM RPA 23.0.3, this parameter is removed.
Beep beep Optional Boolean Enable to play a beep each time that the bot speaks.

Starting from IBM RPA 23.0.3, this parameter is removed.
Language language Optional Language Language used for bot communication. Use the Create a Language (createLanguage) command to get the language variable.
Text text Required Text First question that is asked to get the item that you want from the list.
Text Format textformat Optional Text, BotTextFormat Specifies the text format to send to the chat, either Plain Text or Markdown (default).
Timeout timeout Optional Time Span, Number, Text Timeout for waiting for user response.

Output parameters

Designer mode label Script mode name Accepted variable types Description
Value value Text Text obtained from the item selected by the user.
Utterance utterance Text Returns the text provided by the user.
Timed out timedout Boolean Returns True if the time has run out, otherwise returns False.
Success success Boolean Returns True if the script runs successfully, otherwise returns False.
History Message botHistoryMessageId Text Identifier of this command's message history.

This field returns the identity value of the saved history if one has been set to the Storage Adapter parameter of the Connect to Chatbot (botConnect) command. To use it, simply add this output to the command specific input parameter of which the history you want to link to this command's history.

Example

Provides the user with the "Financial, HR and Development" options and their descriptions, returning the item that was selected.

defVar --name options --type List --innertype String --value "[Responsible for securing resources so that the company can meet its objectives,Responsible for hiring and retaining company employees,Responsible for developing technological services and products.]"
defVar --name optionsDescriptions --type List --innertype String --value "[Finance,HR,Development]"
defVar --name language --type Language
defVar --name text --type String
defVar --name insertedText --type String
//
createLanguage --culture "enUS" language=value
botConnect --type "Chat" --language ${language} --timedout TimeOut --autoanswer--timeout 00:05:00
botSay --text "Welcome!"
botAskList --names ${options} --descriptions ${optionsDescriptions} --confidenceThreshold 100 --beep--text "Which department you would like to talk to?" --timeout 00:05:00 text=value insertedText=utterance
logMessage --message "Utterance:${insertedText}\r\nSelected value: ${text}" --type "Info"
delay --timeout 00:00:03
botDisconnect

Limitations

  • The bot recognizes the chosen option as follows:

    • If the user enters a number, the bot uses the number as the index in the list of options. Thus, the chosen option is the one that matches the index in the list. It is important to note that list indexes always start at 1 in IBM RPA.

    • If the user enters a text that is similar to the one of the option's descriptions, the bot automatically recognizes it and returns the available answers to that option.

  • If the amount of time specified in the Maximum recognition time, Waiting time, Maximum silence time after speech, Maximum time of incomplete speech, and Timeout parameters runs out, the interaction is forwarded to the subroutine specified in the Subroutine parameter.

  • The Maximum recognition time, Waiting time, Maximum silence time after speech, Maximum time of incomplete speech, and Beep parameters are specific for IVR communication.

  • If no value is defined for the timeout parameters, the default timeout is 5 seconds. You can change the default timeout by using the Set Timeout (setTimeout) command.