- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 06-23-2024 04:46 AM
Hi All,
In the article, we will explore how we can utilize GET table API via flow action.
Basic Setup:
- Create a Service Account User
Navigate to [sys_user] table and create a new record with below details:
UserID: sn.integration.user
First name: ServiceNow Integration
Last name: User
Web services access Only: True
- Provide the access to the web service account
Once saved, go to related list named 'roles', click on edit and provide 2 roles:
1. sn_incident_read: This role will provide read access to the Incident Management Application and related functions
2. import_transformer: Can manage Import Set Transform Maps and run transforms
Click on save button.
Now, we will setup a password for this web service user account using the UI Action(Set Password). Click Generate to generate a new password and then Save Password button. Once saved successfully, we will click the copy icon to copy the password value.
Note: Store the password created in notepad as it will be required in upcoming steps.
- Setup Basic Auth Credentials
Navigate to [basic_auth_credentials] table and create a new record with the below details:
The name and password will be same as of the userID and password created in web service account respectively.
Once done, Click on Submit button.
- Create Connection & Credential Aliases
Navigate to [sys_alias] table and create a new record with below details:
Name - SNTableAPI , and save the record.
In the related list named connections, click on new button
Name: SNTableAPI
Credential: sn.integration.user (This one we created in the basic auth credential step)
Connection URL: https://<your_instance_name>.service-now.com/
Save the record.
- Final Setup in Flow Designer
In the filter navigator, search flow designer and open it.
Click on New and select the Action from the dropdown list.
Fill the below:
Action name: Retrieve Active Incident records
Click on Build action
Click on (+) icon and search Rest and select it.
Note: IntegrationHub Plugin is required for this.
Fill the below details:
Connection: Use Connection Alias
Connection Alias: SNTableAPI (This is the Connection & Credential Aliases which we created earlier)
Build Request: Manually
Resource Path: /api/now/table/incident
HTTP Method: GET
Query Parameters: Click on the (+) and define as below:
Once done, click on Save button.
Now we will test it by using Test > Run test button.
Click 'Your test has finished running. View the Action execution details.'
Scroll down and click on 'Steps'
Scroll down and find Step Output Details,
Status Code will be 200
and, Response Body will be as below:
ServiceNow Reference: Advanced Integration Design
Mark this article as helpful if it helped.
- 1,283 Views