# Workbot command trigger
Workbot commands allow you to trigger recipes from Teams. These recipes can then perform actions in your apps (e.g. creating new ServiceNow tickets, listing Salesforce opportunities).
This means you can from perform actions in your apps from within Teams!
Sending a 'newissue' command with additional parameters in Teams, then receiving a reply
When a command is sent to Workbot in Teams, it will trigger the Workbot recipe and execute its actions.
A Workbot recipe with a Workbot command trigger
# Configuring the command
Example 'newissue' command
# Input fields
The table below lists the input fields in the trigger and what they do.
|Command name||Name of the command.|
|Parameters||Parameter can store additional data that can be used as datapills in follow-up recipe actions.|
|Command hint||Display this instead of command name in response to help messages.|
|Hidden command||If Yes, command will not show up as a command in help messages. Defaults to No.|
# Command name
Workbot commands can invoke their recipes by:
- Sending the command name in a direct message to Workbot, e.g. newissue
- Sending the command name in a channel and tagging Workbot, e.g. @workbot newissue
- Submitting a button with the command name configured: A button can be configured to invoke a Workbot command of another recipe
The 'Create issue' button invokes the 'newissue' command and executes the recipe when submitted
Each parameter can store additional data that can be used as datapills in follow-up recipe actions.
For example, to create an incident in ServiceNow, you may want to prompt users for additional info like Urgency, Summary and Description. By adding Urgency, Summary and Description as parameters, Workbot will open a task module and prompt the user for each parameter.
Workbot can ask users for info if you specify additional parameters in your command
Users can also skip the prompts by supplying the parameters together with the command.
Sending a 'newissue' command with additional parameters Urgency, Summary and Description
# Defining parameters
3 parameters configured for the 'newissue' command
When you define parameters, Workbot opens a task module to collect each parameter's value from the user.
To add a parameter, click on the +Add parameter button under the Parameters section of a Workbot command trigger.
Adding a new parameter
By configuring the parameter, you can control how the users interact with the parameter in the task module.
Configuring a parameter
The table below describes in further detail what each parameter configuration field does.
Name of the parameter. This is the name you use to reference the parameter in:|
Data type of the parameter. Currently only supports |
|Optional?||If set to Yes, users can skip this input. If set to No, users are required to provide this input.|
|Hint||Hints are displayed just below the input field for users when filling in the input field.|
|Example input value||Displays a placeholder for the field in the task module. Useful in giving the user a sense of what the requested input should look like, as well as the desired format.|
|Visible?||If Yes, command will not show up in task modules. Useful if the parameter is a record ID that is not human-readable. Defaults to No.|
|Options||Comma-separated list of options, e.g. APPROVED, REJECTED, EXPIRED. If the display name and athe value are different, separate the two by a colon, e.g. High:1,Medium:2,Low:3.|
# Advanced methods to pass parameter values
Parameter values can also be passed by buttons and task modules as they invoke a Workbot command. Typically, you use parameters to pass context to the invoked Workbot recipe.
The 'Re-open issue' button not only invokes the 'reopen_issue' command - it's also passing parameters!
The 'Re-open issue' button is configured to pass the 'sys_id' so that the 'reopen_issue' recipe knows which issue to re-open
Another way to pass a parameter is by using a pick list Choice parameter.
The choice parameter will take its value from a choice (if it's chosen)
The choice parameter is passed when a button from the same message is submitted (along with any other parameters the button may have).
The 'Next' button also passes the 'opportunity_id' of 'Google' onto the command recipe that it invokes