Access Catalog Task variable values using API

t_h1
Giga Contributor

I'm new to ServiceNow and assisting automation process. I can access catalog task information using SC_Task API end point but seems like Variables are store somewhere else. If I have a TASK000001 and need to retrieve value assigned to variable "X". How can I do that? Is there a table that links to Variables -> Values?

1 ACCEPTED SOLUTION

Hi,

It works in the REST API Explorer, you just have to use:

variables.field_name

Example of setup (you can use sc_task table as well, as mentioned above):

find_real_file.png

find_real_file.png

And on RITM itself:

find_real_file.png

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

6 REPLIES 6

Hola, disculpa estoy intentando insertar variables a un query, los datos son 

Variable formulario

Sys id

Tipo de Factura:

86b0bdc3477f5150ccb0e8d3636d4324

No. Órden de Compra:

e02637844798e190ccb0e8d3636d430e

Línea(s) a asociar:

b014de6c47506590ccb0e8d3636d432f

Método de pago:

6741b621db78e91064a12cdcd3961955

sin embargo no se como realizar la consulta. 

un query que estoy usando es 

"state=10&variables.xxxxxxx=Tarea 1 - xxxxxxx&variables.86b0bdc3477f5150ccb0e8d3636d4324=Proveedor Nacional&sysparm_display_value=true" este me trae información pero los campos que requiero no los consigo. 

 

por favor su ayuda.

t_h1
Giga Contributor

Thank you, that worked, I just learned about the sysparm_field to get the additional field that's not in the normal API call against that table.