- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 12:18 AM
Hi,
Does anyone know if it is possible to update requested items variables using REST API?
I tried it using the REST API Explorer, directly on the sc_req_item table with this body:
========
{"variables.person_name":"Eli"}
=======
i was able to update a field, but not the variables.
thank you!
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 01:23 AM
Hi Eli,
Create a Scripted REST API and resource as PUT.
Have some sample json incoming request such as below:
{
"ritm": "RITM0001",
"variables": {
"user": "user1",
"email": "user1@example.com",
"phone_number" : "789-975-0000"
}
}
Once you receive this as incoming json request parse this and get the value of ritm json key i.e. RITM0001
get the variables value from the json by parsing it and update the variable with the values.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
‎11-07-2017 12:32 AM
Hi Eli,
Fields are at dictionary level so you can directly update those.
Catalog item variables values are stored in the following table i.e. Variable Ownership sc_item_option_mtom
One more thing you can do is send the RITM number and values for the variables and use PUT method and get the json request and update the corresponding variables by querying the RITM number
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
‎11-07-2017 12:38 AM
Thank you Ankur!
Can you please elaborate a bit more on the second option? maybe an example?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 01:23 AM
Hi Eli,
Create a Scripted REST API and resource as PUT.
Have some sample json incoming request such as below:
{
"ritm": "RITM0001",
"variables": {
"user": "user1",
"email": "user1@example.com",
"phone_number" : "789-975-0000"
}
}
Once you receive this as incoming json request parse this and get the value of ritm json key i.e. RITM0001
get the variables value from the json by parsing it and update the variable with the values.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
‎07-23-2018 05:03 AM
Hi Ankur,
I had a similar requirement.
My issue was , using PUTalthough i could retrieve the value of a (no role read acl) reference field.
But was not able to update it, neither was able to update a string fields.
sysparm_input_display_value and sysparm_display_value is set true
JSON query format:
{"variables.template":"1-Generic Template","comments":"test1"}
Response(number and variables.template to be returned):
{
"result": {
"number": "RITM0691191",
"variables.template": "Account Access"
}
}