Bot Request File
Prompts the user for a specific file during an interaction.
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.
chatAskFile [--fileextensions(String)] [--retry(Boolean)] [--attempts(Numeric)] [--retrytext(String)] [--timeoutsub(String)] [--language(Language)] --text(String) [--textformat(String)] [--timeout(TimeSpan)] (String)=value (String)=utterance (Boolean)=timedout (Boolean)=success (String)=botHistoryMessageId
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 |
---|---|---|---|---|
File extension | fileextensions |
Optional |
Text |
File extension that is requested from the user. Use the .extension format to specify the extension.Example: .pdf |
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 from Alternative texts is repeated. |
Alternative texts | retrytext |
Optional |
Text |
Alternative question that is asked to the user if there is no answer on the first attempt. |
Time out subroutine | timeoutsub |
Optional |
Text |
Subroutine that runs if user response time runs out. |
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 |
Question that is asked to get the file. |
Timeout | timeout |
Optional |
Time Span , Number , Text |
Timeout for user response. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Value | value |
Text |
Full path and file name entered by the user. |
Utterance | utterance |
Text |
Returns the text provided by the user. |
Timed out | timedout |
Boolean |
Returns True if user response time runs out, otherwise returns False . |
Success | success |
Boolean |
Returns True if the file is received successfully, otherwise returns False . |
History Message | botHistoryMessageId |
Text |
Value to link the history of other commands to the history of this command. This field returns the identity value of the saved history if one has been set Storage Adapter at Connect to Chatbot. To use it, simply add this output to the command-specific input parameter's history that you want to link this command's history to. |
Example
The robot prompts the user for a file in PDF format, returning the full path and file name received.
defVar --name languageUs --type Language
defVar --name pdfFileInformed --type String
defVar --name phraseInsert --type String
createLanguage --culture "enUS" languageUs=value
botConnect --type "Chat" --language ${languageUs} --timedout TimeOut --autoanswer--timeout 00:05:00
chatAskFile --fileextensions ".pdf" --language ${languageUs} --text "Please send us the slip in PDF format for review." --timeout 00:05:00 pdfFileInformed=value phraseInsert=utterance
botDisconnect