How to get the Variables of RITM using REST Method

Priya Gautum
Kilo Guru

Hi Team

Can you please tell me how to get the Variables of RITM using Rest Method.

Regards,

Priya

1 ACCEPTED SOLUTION
16 REPLIES 16

Hi Priya,

you can have it based on out of the box API.

If not then go ahead with scripted rest api

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

palanikumar
Mega Sage

Go for Scripted Rest and add your script that can pull variable and pass it as rest output. Refer the below link for more details:

 

https://docs.servicenow.com/bundle/newyork-application-development/page/integrate/custom-web-service...

Thank you,
Palani

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Priya,

Sample endpoint here

query I have given is number=RITM0010190

URL: https://instanceName.service-now.com/api/now/table/sc_req_item?sysparm_query=number%3DRITM0010190&sysparm_fields=number%2Cvariables.test%2Cvariables.vendor_lot_number

HTTP Method: GET

give all the variables name in the sysparm_fields as variables.<variableName>

separate each variable with %2C

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

I used this solution and it works for me very well. Thank you!

@Ankur Bawiskar : I required something like this and your quick help article was exact help for me , thanks Ankur once more.