Extract RITM data via API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-30-2022 05:46 PM
I am new to Service Now as well as API , So my question could be as silly as one could imagine.
Need to extract information via API
I am using API and sc_req_item to fetch the data.
Request : -https://test.service-now.com/api/now/table/sc_req_item?sysparm_query=active%3Dtrue%5Eshort_descriptionSTARTSWITHTest%20Connect%5Eapproval%3Drequested%5EstateNOT%2C-5%2C-25%2C6%2C3%2C4%26
I have used OAuth 2.0
I was able to extract much of the data via above request, however on a customer request tab, there is a table for which i was not able to extract data.
I am attaching SS for review.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-31-2022 09:00 PM
Those are called variables. If you know the variable name then you can use sysparm_fields query parameter to get the details, when you use the sysparm_fields in your API endpoint then the result JSON will contain values of the fields you mentioned
sysparm_fields=number,variables.short_description,variables.description
https://test.service-now.com/api/now/table/sc_req_item?sysparm_fields=number,variables.<variable_name>,variables.<variable_name>&sysparm_query=active%3Dtrue%5Eshort_descriptionSTARTSWITHTest%20Connect%5Eapproval%3Drequested%5EstateNOT%2C-5%2C-25%2C6%2C3%2C4%26
Sample Response:
I've just used number and 2 variables in the sysparm_fields query parameter so I'm getting the response as shown in the below screenshot.
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-31-2022 10:21 PM
Hi
I queried them via ParentID(SysID) and able to get the result.
https://test.service-now.com/api/now/table/sc_multi_row_question_answer?parent_id=g654478qn45yy72hhsq541g567ytre9&sysparam_display_value=true&sysparam_fields
Which give me a desired result as expected
Thanks for your reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-01-2022 12:22 AM
Thanks & Regards,
Vasanth