Bot Start On Hold

Starts a wait state in an chatbot interaction.

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

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.

botStartOnHold [--message(String)] (String)=value

Dependencies

Use the End Wait command to end the wait state.

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
Message message Optional Text The text message to send while the chatbot is on hold.

Output parameters

Designer mode label Script mode name Accepted variable types Description
Success value Text Returns True if the wait was started successfully, or False otherwise.

Example

In this example, the Bot Start On Hold command is used, after receiving the user's ZIP code, to send the message "Wait a moment, we are searching for your zip code!” until the “consultZipCode” routine runs completely and the wait is ended with the use of the End Wait command.

defVar --name language --type Language
defVar --name userResponse --type Numeric
defVar --name consultationSuccess --type Boolean
defVar --name convertedZipCode --type String
createLanguage --culture "en-US" language=value
botConnect --type "Chat" --language ${language} --timeout "00:03:00"
	botAskNumber --text "Hello, to consult your zip code, please type it without punctuation." --textformat "Markdown" --timeout "00:03:00" userResponse=first
	// Start of waiting by sending a message in the chat.
	botStartOnHold --message "Wait a moment, we are searching for your zip code!" --textformat "0"
		goSub --label consultZipCode
		// Closing of the wait after consultation with the ZIP code.
	botStopOnHold
	if --left "${consultationSuccess}" --operator "Is_True"
		botSay --text "ZIP Code ${convertedZipCode} successfully found!" --textformat "0"
	else
		botSay --text "ZIP Code ${convertedZipCode} not found!" --textformat "0"
	endIf
botDisconnect
beginSub --name consultZipCode
	convertNumberToText --culture "en-US" --number ${userResponse} --conversiontype "SimpleNumber" --decimals 0 convertedZipCode=value
	webStart --name web01 --type "Chrome"
	webNavigate --url "https://www.unitedstateszipcodes.org/"
	webClick --selector "Id" --id q
	webSet --value "${convertedZipCode}" --selector "Id" --id q
	webClick --selector "CssSelector" --css "#search-forms > div.col-xs-12.col-lg-7 > div > span.input-group-btn > button"
	webWaitElement --selector "CssSelector" --css "#map-info > table" consultationSuccess=value
	webClose --name web01 --leavebrowseropen
endSub