Configure a ServiceNow web trigger to trigger an action whenever an event occurs in the ServiceNow instance. This example shows how to create a Task Bot with a ServiceNow web trigger to display the incident number in the message box.

The ServiceNow web trigger monitors the Incidents table of a ServiceNow instance for events. When a new record is added to the Incident table, the trigger initiates the Message Box action to display the incident number.

Prerequisites

Ensure that the following prerequisites are met:

Procedure

  1. Perform the following steps to create a Task Bot
    1. On the left pane, click Automation.
    2. Click Create > Task Bot.
      The Create Task Bot wizard is displayed.
    3. Enter an appropriate name for the bot in the Name field.
      All the bots are stored in <\Bots> folder by default.
    4. Optional: Add a description for the bot in the Description field.
    5. Optional: Click Choose and follow the prompts to save the bot in a different folder.
    6. Click Create & Edit.
      The bot is created and the Edit Task Bot is displayed.
  2. Perform the following steps to add and configure the ServiceNow web trigger.
    1. Click Triggers > ServiceNow, and then double-click or drag Web trigger to add the web trigger to Triggers section.
    2. Enter the ServiceNow instance URL in the ServiceNow URL field.
    3. Enter incident in Event Type (table) field as this trigger is configured to monitor the Incident table of the ServiceNow instance.
    4. Select When new record is inserted option from the Listen to event drop-down.
    5. Enter the search filter from the ServiceNow Incident table in Filter criteria (optional) field.
      Right-click on the filters displayed on the Incident table in ServiceNow, and then click Copy query to copy the filter. Paste the copied filter in the Filter criteria field.
    6. Enter the roles defined in the ServiceNow instance in the Filter criteria by Role (optional).
    7. Click Pick to choose the preconfigured OAuth connection from the Pick an OAuth connection modal.
      Only Control Room managed OAuth connections are supported. See Use OAuth connection for more information.
    8. Select ServiceNowTriggerData from the Response drop-down.
      The trigger response data contains all the information about the event in which the change occurred and is saved in key-value pair format. You can also select an existing record variable from the drop-down list.
  3. Perform the following steps to add and configure the Microsoft 365 Outlook Connect action.
    1. Click Actions > Message Box, and then double-click or drag Message Box action to add it to the Actions section.
    2. Enter an appropriate title for the message box in Enter the message box window title.
    3. Enter $ServiceNowTriggerData{triggerType}$ in Enter the message box window title.
      This variable sets the triggerType key from the trigger response data as the window title of the message box.
    4. Enter $ServiceNowTriggerData{number}$ in Enter the message to display.
      This variable sets the number key from the trigger response data as the message that must be displayed in the message box.
  4. Click Save to save the automation.
When you click Run > Run with triggers, the system activates the trigger and the trigger starts listening for When new record is inserted event in the Incidents table of the monitored ServiceNow instance. When a new incident with incident number INC0010015 is created, the trigger starts the Message Box action. A message box is displayed with window title as ServiceNow Trigger and message as INC0010015.