Table API get all Variables for RITM

JakobR
Tera Contributor

Using the Table API I can get the response of a sc_task and sc_req_item however to get any variable on those I need to add the specific variable name to the sysparm_fields like this:

 

 

https://<instance>.service-now.com/api/now/table/sc_req_item/<id>?sysparm_fields=variables.xyz

 

 

I need to grab all of the variables regardless of the particular RITM I'm looking at, I've read about ways to grab the variables by going through the sc_item_option and sc_item_option_mtom tables but that doesn't make sense from a security or design standpoint, if I can sysparm_fields for the variables I'm looking for then I should have access to the variables without access to the other tables.

 

I'm looking for a way to get all variables for a given RITM when I'm not sure what the variable names are.

 

Is there really no way to simply fetch all of the variables instead of dot walking every individual variable by name?

1 REPLY 1

Abbas_5
Tera Sage
Tera Sage

Hello @JakobR,

Please refer to the links below:
https://www.servicenow.com/community/developer-forum/get-variable-values-from-ritm-using-rest-api/m-...

https://www.servicenow.com/community/service-management-forum/how-to-get-the-variables-of-ritm-using...

 


If it is helpful, please mark it as helpful and accept the correct solution. In future, it might be helpful for someone to refer to this solution.

Thanks & Regards,

Abbas Shaik