- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 05:37 AM
Hello,
I am using database view in servicenow REST API. I want to retrieve particular record from the view results.
Like for table api, we have the GET call (GET /api/now/table/<tablename>/<sys_id>). Can there be something like this for database view?
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 06:09 AM
To Filter using OR conditions, you can add value for the sysparm_query = value=Service Desk^ORvalue=Software
The best way to get your query is to apply the filter on the table and Copy query by right clicking the filter and paste it on sysparm_query
The URL will be displayed in the API
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 05:44 AM
Hi Raj,
You can use the same get API, In place of table you should replace the table name of a database base view and you should be able to query it. You can try testing it for the OOB database view metric_instance from REST API explorer.
Click on Send and it will give a response data.
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 06:03 AM
Hello Alikutty,
I was able to retrieve the results from database view using REST API. Let me rephrase my query. I want to apply filters to the results. How do I apply 'OR' operation in the url to filter the results?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 06:09 AM
To Filter using OR conditions, you can add value for the sysparm_query = value=Service Desk^ORvalue=Software
The best way to get your query is to apply the filter on the table and Copy query by right clicking the filter and paste it on sysparm_query
The URL will be displayed in the API
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 06:22 AM
Hello Alikutty,
Thanks for your help.