Set Bot Language

Sets a new language as default for a bot's communication.

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 default language is the one set in the Connect to Chatbot command. Therefore, whichever language is defined with the Set Bot Language command is valid only for commands subsequent to it.

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.

setLanguage --language(Language)

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
Language language Required Language Variable with the new language that is assigned as the default language.
You can use the Create a Language command to get the Language variable.

Example

Communication is established with the user, who is asked about their country so that a new language can be assigned if the user is in the "United States".

defVar --name languagePortuguese --type Language
defVar --name languageEnglish --type Language
defVar --name country --type List --innertype String --value "[Brazil,United States]"
defVar --name userOption --type String
defVar --name utterance --type String
defVar --name userName --type String
// Creation of languages.
createLanguage --culture "pt-BR" languagePortuguese=value
createLanguage --culture "en-US" languageEnglish=value
botConnect --type "Chat" --language ${languagePortuguese} --timeout "00:05:00"
	botAskList --names ${country} --text "Olá. Qual seu país?\r\nHello. What is your country?" --textformat "Markdown" --timeout "00:05:00" userOption=value
	if --left "${userOption}" --operator "Contains" --right "United States"
		// Assignment of the new language.
		setLanguage --language ${languageEnglish}
		botAskName --confidenceThreshold 100 --beep  --text "What is your name?" --textformat "Markdown" --timeout "00:01:00" utterance=utterance userName=first
		botSay --text "Hello, ${userName}!" --textformat "Markdown"
	elseIf --left "${userOption}" --operator "Contains" --right Brazil
		botAskName --beep  --text "Qual seu nome?" --textformat "Markdown" utterance=utterance userName=first
		botSay --text "Olá, ${userName}!" --textformat "Markdown"
	endIf
botDisconnect