- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2021 10:40 PM
Hi,
I have a requirement to get SCTASK catalog variables. Can this be achieved?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2021 11:23 PM
Hi Ankur,
Was able to achieve this by using the below API.
https:<instance url>/api/now/table/sc_task?sysparm_query=number=<sc_task number>&sysparm_display_val...
We can directly add the variables.<variablename> in the link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2021 10:45 PM
Hi,
variables information is stored at RITM level
you will have to do 2 API calls
1) get RITM for your SC Task
2) Then query with variables.xxxx=YYYYYY for those RITMs
OR
You need to create Scripted REST API and then get the record matching the query
refer below link
Scripted REST APIs & Retrieving RITM Variables via SRAPI
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2021 11:23 PM
Hi Ankur,
Was able to achieve this by using the below API.
https:<instance url>/api/now/table/sc_task?sysparm_query=number=<sc_task number>&sysparm_display_val...
We can directly add the variables.<variablename> in the link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2021 07:56 PM
I did the same and I can see the variables in the API results. However, I have been trying to set fields on the receiving end of the API to be equal to the variables but I am not having luck. I am able to set the fields from sc_task to the fields on my form but not the variables. I have tried gr.field1 = variables.<variable_name>; but it is not working. I am trying to explore other ideas but curious if you could shed some light on what you did after setting up the API and endpoint. Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2021 12:19 AM
Hi,
So you are trying to update variable value via API or using some script?
Can you share some details on this
Also since this is an old thread I would suggest to create a new question and you can tag me there.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader