- Overview
- Adobe Sign
- Alteryx
- Amazon Comprehend
- Amazon Connect
- Amazon Rekognition
- Amazon Textract
- Box
- Release notes
- About the Box activity package
- Fix XAML After Package Update
- Project compatibility
- Setup
- Technical references
- Box Scope
- Commit Session
- Create File Version Session
- Create Upload Session
- Upload Part
- Delete Old Version
- Get Versions
- Promote Version
- Upload File Version
- Copy File
- Delete File
- Download File
- Get File Comments
- Get File Info
- Get File Info Details
- Get File Lock Info
- Lock File
- Move File
- Unlock File
- Upload File
- Copy Folder
- Create Folder
- Delete Folder
- Get Folder Info
- Get Folder Items
- Rename Folder
- Search For Content
- Execute Method
- Cognitive
- DocuSign
- Release notes
- About the DocuSign activity package
- Project compatibility
- Setup
- DocuSign Scope
- Invoke DocuSign Operation
- Create Envelope
- Create Envelope And Send
- Create Envelope From Template
- Create Envelope Recipients
- Get Document
- Get Documents
- Get Envelope
- Get Form Data
- Send Envelope
- Update Envelope
- List Attachments
- List Custom Fields
- List Documents
- List Envelope Status Changes
- List Recipients
- Create Bulk Send List
- Create Bulk Send Request
- Get Bulk Send List
- Get Bulk Send Lists
- Create Template Custom Fields
- Create Template Recipients
- Get Template
- List Templates
- Google Vision
- Jira
- Release notes
- About the Jira activity package
- Project compatibility
- Setup
- Jira Scope
- Execute Method
- Add Attachment
- Delete Attachment
- Download Attachment
- Get Attachments
- Add Comment
- Delete Comment
- Get Comments
- Create Component
- Delete Component
- Get Components
- Search Dashboards
- Create Filter
- Get Filters
- Create Issue Link
- Delete Issue Link
- Get Issue Link Types
- Get Issue Links
- Add Watcher
- Assign Issue
- Clone Issue
- Create Issue
- Delete Issue
- Get Issue
- Get Watchers
- Remove Watcher
- Search Issues Using JQL
- Transition Issue
- Update Issue
- Create Project
- Delete Project
- Get Project Types
- Get Projects
- Update Project
- Get Transitions
- Create User
- Delete User
- Find Users
- Marketo
- Microsoft Dynamics
- Microsoft Dynamics Finance and Operations
- Microsoft Translator
- Microsoft Vision
- Oracle Integration Cloud
- Oracle NetSuite
- Salesforce
- Release notes
- About the Salesforce activity package
- Project compatibility
- Setup
- Quickstart
- Salesforce Application Scope
- Create Bulk API Job
- Get Bulk API Job
- Get Bulk API Job Results
- Start or Abort Bulk API Job
- Assign File
- Download File
- Upload File
- Composite Request
- Delete Record
- Get List View Records
- Get Record
- Insert Record
- Update Record
- Upsert Record
- Execute Report
- Execute SOQL
- Format Column Names
- Format Labels And Values
- Lightning REST API Request
- Search
- SAP BAPI
- ServiceNow
- Release notes
- About the ServiceNow activity package
- Project compatibility
- Setup
- Technical references
- Troubleshooting
- Quickstart - Objects and Attachments
- Quickstart - How to Use Search ServiceNow Records
- Slack
- Smartsheet
- Release notes
- About the Smartsheet activity package
- Project compatibility
- Setup
- Technical references
- Quickstart: Working With Rows
- Smartsheet Application Scope
- Attach File
- Attach URL
- Delete Attachment
- Get Attachment
- List Attachments
- Add Comment
- Delete Comment
- Get Comment
- List Discussions
- Copy Folder
- Create Folder
- Delete Folder
- Get Folder
- List Folders
- Add Group Members
- Get Group
- List Groups
- Remove Group Member
- Get Report
- List Reports
- Add Rows
- Copy Rows
- Create Discussion on Row
- Delete Rows
- Get Row
- List Rows
- Move Rows
- Update Rows
- Copy Sheet
- Create Sheet
- Create Sheet From Template
- Download Sheet
- Get Sheet
- List Sheets
- Update Sheet
- Add User
- Get User
- List Users
- Remove User
- Copy Workspace
- Create Workspace
- List Workspaces
- Import Sheet From CSV / XLSX
- Invoke Smartsheet Operation
- Search Activity
- Send Via Email
- Share Object
- SuccessFactors
- Tableau
- Twilio
- Workato
- Workday
Quickstart - How to Use Search ServiceNow Records
The purpose of this guide is to walk you through several examples of how to query for data using the Search ServiceNow Records activity.
You can enter a query such as "name-value pairs=state=closed" which says to filter the list of objects (such as an Incident) where the state is closed. This is described on ServiceNow's documentation and you can test this out using the ServiceNow REST API explorer. Our activity takes the query that the user supplies and appends it to the relevant ServiceNow REST API call and then receives the results.
The problem for some customers is that it is not easy to understand how to create queries, how to test queries, or that the person is not technical to the extent that learning and using the ServiceNow REST API explorer is practical.
ServiceNow's documentation regarding building queries that can be used with their REST API is located in the Encoded query strings documentation. This is a useful resource if you want to learn how to build queries that can be used with the Search ServiceNow Records Activity.
Below are some query examples that can be used with the Incidents object:
Query |
Description |
---|---|
|
Returns all records, but returns only the three columns specified (number, sys_created_on, and sys_created_by) |
|
Return all records where state is closed. |
|
Return only the three columns (number, sys_created_on, and sys_created_by) for each record, return only records where the state is Open, and limit the results to 1 record. |
|
Return all records where the priority is 2. |
|
Return all records where the short description is like network |
|
Return one record where the number is INC0010060 and only return three columns as part of the result (sys_id, number, short_description) |
There are two other methods to create and obtain useful queries that can be used with this activity.
- Option A: Copy any query from the ServiceNow UI.
- Option B: Copying the query string from the browser.
Option A: Copy any query from the ServiceNow UI
You will need to prepend the text "sysparm_query=" to any query that results per the steps below.
Step 1
Go to an object, Incidents in this case.
Step 2
Clear out the filters and create a new filter. In our case we are looking for any Incidents whose number ends with the string "100".
Step 3
Copy the query suing the Copy Query menu item. It will look like numberENDSWITH100.
Step 4
Paste this into the Search ServiceNow Records activity. You can do this in the Test Query window as seen below, or in the query property of the activity.
Be sure to pre-pend sysparm_query= in front so that it looks like sysparm_query=numberENDSWITH100, else it will not work correctly.
Option B: Copying the querystring from the browser.
In this option you do not have to remember to do add anything as a pre-pending step. You can copy and paste the query string if you use the Open new Window option like below:
Step 1:
Create the filter you want to use as before in Option A.
Step 2: Right-click and choose the Open new window menu option.
Step3: Copy the query string in toto (everything after the question mark "?"). Then paste it directly in the “Test Query” dialog of the Search ServiceNow Records activity as seen below.