Update requested item variables using REST API

Eli Guttman
Tera Guru

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!

1 ACCEPTED SOLUTION

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


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Hi Shariq,

Can you explain in detail what is your scenario and what issue you are facing?

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Eli,



Any update on this?


Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.



Regards


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi,

Could you please help me with updating the RITM variables using the rest API?

Thanks

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Eli,



Any update on this?


Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.



Regards


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader