LogoLogo
  • Docs
  • Connector Configuration
  • Knowledge Base
  • Changelog
  • Connector Configuration
  • ActiveCampaign
  • Airtable
  • Asana
  • AWS
    • AWS SNS
  • Azure Cognitive Services
  • Blackboard
  • CloudFlare
    • CloudFlare Lists
  • DeepAI
  • DocuSign
  • Dropbox
  • Facebook Business
  • Freshdesk
  • Google
  • Highrise
  • Hubspot
  • Imperva
  • Jira
  • Jotform
  • LinkedIn
  • Mailchimp
  • Microsoft
  • Microsoft Dynamics 365 CRM
  • Monday
  • Open AI
  • Pipedrive
  • Quickbooks
  • Redmine
  • Salesforce
  • Schoology
  • Screenshot API
  • ServiceNow
  • Shopify
  • Slack
  • Snowflake
  • Trello
  • Twilio
  • Twitter
  • Typeform
  • Utilities
    • AI
    • AppEvents
    • Controls
      • Condition
      • Counter
      • Digest
      • Each
      • Join
      • Join Each
      • On Start
      • Set Variable
      • Switch
    • Converters
      • Archive
      • CSV to HTML
      • CSV to JSON
      • CSV to XLSX
      • Data URI to File
      • HTML to CSV
      • HTML to JSON
      • HTML to XLSX
      • JSON to CSV
      • JSON to HTML
      • JSON to XLSX
      • XLSX to CSV
      • XLSX to HTML
      • XLSX to JSON
    • CSV
      • Add Column
      • Add Row
      • Add Rows
      • Create CSV
      • Delete Columns
      • Delete Rows
      • Export CSV
      • Get Cell
      • Get Row
      • Get Rows
      • Import CSV
      • Rename Column
      • Update Rows
    • Email
    • HTTP
      • Delete
      • Dynamic Webhook
      • GET
      • PATCH
      • POST
      • PUT
      • Response
      • Uptime
      • Webhook
    • Language
    • Tasks
      • Request Approval
      • Request Approval Email
    • Test
      • After All
      • Assert
      • Before All
      • Call Count
      • Join
      • Process E2E Results
      • Tick
    • Timers
      • Scheduler
      • Timer
      • Wait
    • Weather
    • XML
      • JSON to XML
      • Validate XML
      • XML to JSON
      • XPath
    • Storage
      • Clear
      • Find
      • Get
      • On Item Added
      • On Item Removed
      • On Item Updated
      • Remove
      • Save To File
      • Set
    • RSS
      • Get Feed
      • New Feed Item
    • FTP
      • Create Directory
      • Download File
      • Get File Info
      • New File
      • Remove Directory
      • List
      • Remove File
      • Rename File
      • Upload File
    • Forms
      • Form Action
      • Form Trigger
    • Filters
      • Contains
      • Equals
      • Greater Than
      • Identity
      • Is Not Empty
      • Less Than
      • Modulo
      • Not Equal
      • Range
    • Files
      • Archive File
      • Download File
      • Load File
      • Load File Lines
      • Remove File
      • Save File
  • Xero
  • Zendesk Chat
  • Zendesk Tickets
  • Zoho
Powered by GitBook
On this page
  • Setup the App administrator account
  • Setup Webhooks

Was this helpful?

Export as PDF

ServiceNow

PreviousScreenshot APINextShopify

Last updated 6 months ago

Was this helpful?

Setup the App administrator account

App admin url:

Once the app admin account is created and verified you need to create an instance.

It will take a minute or two or three or five to complete.

Setup Webhooks

To configure webhooks in ServiceNow to receive notifications when a new record is created, follow these steps. This involves creating an Outbound REST Message, setting up a Business Rule to capture record creation, and configuring the webhook.

Create an Outbound REST Message:

  • Navigate to System Web Services > Outbound > REST Message.

  • Click on the New button to create a new REST Message.

  • Fill in the fields such as:

    • Name: e.g., AppmixerNotifications.

  • Click Submit and then open the newly created REST Message.

  • Click on the HTTP Methods tab and create a new HTTP Method.

  • Fill in the details such as:

    • Name: e.g., events.

    • HTTP Method: POST.

    • Endpoint: Ensure this is filled with your webhook listener’s URL.

  • Optionally, add default HTTP Request Headers (e.g., Content-Type) and customize the Request Body or Query Parameters if needed.

  • Save the HTTP Method.

Create a Business Rule:

  • Navigate to the table for which you want to capture new record creation. For example, if it’s the Incident table, go to Incident > All.

  • Right-click on the form header and select Configure > Business Rules.

  • Alternatively, you can navigate to Activity Subscriptions -> Administration -> Business Rules.

  • Click on the New button to create a new Business Rule.

    • Set the fields as follows:

    • Name: e.g., Incident Rules.

    • Table: Select the appropriate table (e.g., Incident).

    • When: Insert.

  • Under Advanced, check the box Advanced to open the script editor.

  • In the Script section, add the following code:

    • Note that AppmixerNotifications should be the same as the name of the Outbound REST Message in the previous step.

    function serializeGlideRecordToJSON(gr) {
        const obj = {};
        const fields = gr.getFields();
    
        for (let i = 0; i < fields.size(); i++) {
            const field = fields.get(i);
            const fieldName = field.getName();
    
            // skipping sys_id and other sensitive fields if necessary
            if (fieldName !== 'sys_id' && fieldName !== 'sys_updated_on' && fieldName !== 'sys_created_on') {
                obj[fieldName] = gr.getValue(fieldName);
            }
        }
    
        return obj;
    }
    
    if (current.operation() === 'insert') {
    
        const rq = new sn_ws.RESTMessageV2('AppmixerNotifications', 'events');
        const requestBody = {
            'type': 'incident.insert',
            'data': serializeGlideRecordToJSON(current)
        };
    
        rq.setRequestBody(JSON.stringify(requestBody));
        rq.execute();
    }
    

    The code above handles only new records in the incidents table. If you want to track new items in other tables, create another business rules and send the notifications to the Appmixer endpoint, where the type of the event is in format like: '.insert':

    const rq = new sn_ws.RESTMessageV2('AppmixerNotifications', 'events');
    const requestBody = {
        'type': 'tasks.insert',
        'data': serializeGlideRecordToJSON(current)
    };
    
    rq.setRequestBody(JSON.stringify(requestBody));
    rq.execute();

Now your developer instance is ready and accessible: . Note that when creating a new account, your instance ID (dev180380 in this case) will be different.

Endpoint: https://<YOUR_API_BASE>/plugins/appmixer/servicenow/events for example https://api.appmixer.com/plugins/appmixer/servicenow/events

https://dev180380.service-now.com/
https://developer.servicenow.com/dev.do#!/home
Business Rule