The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Access multi-row variable set from RITM using Rest API

竜太畠
Tera Contributor

I am investigating how to retrieve ticket information created in the service catalog from an external system (Python).

I understand that by specifying “variables.variable_name” in the sysparm_fields of the sc_req_item table API, values for variable information other than MultiRow can be obtained in the format below.

“variables_variable_name”: “The selected value displayed on the screen


If you want to acquire MultiRow data, aside from accessing individual related tables through Sys_id as shown below to obtain data, is there any good solution available at the moment?

<MultiRow relationship table>
sc_req_item、sc_multi_row_question_answer、sc_item_option_new

 

If we use JSONv2, I thought we could also obtain values for MultiRow. However, if many API executions are expected, there is a concern that this may affect the responsiveness of user screen interactions, so I believe it should be viewed as a non-recommended approach.Is my understanding correct?

Solved: Re: Rest API vs JSONv2 - ServiceNow Community


<Similar questions from 2020>

Solved: Access multi-row variable set from RITM using Rest... - ServiceNow Community

If the situation has not changed since 2020, I understand that I need to run an API on the “MultiRow relationship table” mentioned above to format the data.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@竜太畠 

you won't get MRVS data using the OOTB Table API on sc_req_item as MRVS data is stored in other table

Another way is this to use Scripted REST API

How to fetch Multirow variables on RITM/SCTASK using REST api 

Another way is to use table API on Multi Row Question Answer [sc_multi_row_question_answer]

check how it's done

Example below

AnkurBawiskar_1-1750771196948.png

 

AnkurBawiskar_2-1750771197032.png

 

AnkurBawiskar_3-1750771196904.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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

View solution in original post

8 REPLIES 8

Marcos Kassak
Kilo Sage
Kilo Sage

Hi @竜太畠,

 

You might want to explore the batch API (/api/now/batch) for your solution. Once you have the RITM sys_id, you can include additional table queries (e.g sc_multi_row_question_answer) in a single request. Note that each RITM will still need a separate query for MRVS data, but batching helps reduce round trips. Alternatively, creating a scripted REST API to execute the required lookups server-side and return a structured response could simplify your external system’s logic.

 

You're also right to consider transaction volume and whether the data needs to be fetched in real-time. For instance, syncing when a user opens a record could work, or you could pre-load data into a data warehouse to reduce live API usage and ServiceNow API semaphores impact. It will really depend on the actual size of your instance the strategy you will follow here.

 

Hope this helps!

 

If you found my answer helpful or correct ✔️ in any way, please don't forget to mark it to help future readers! 👍

 

--

 

Kind regards,


Marcos Kassak

ServiceNow MVP 2024, 2025 
Solution Architect  🎯


Thank you for marking my response as helpful. If my response helped, please mark it correct and close the thread so that it benefits future readers. 👍

 

Ankur Bawiskar
Tera Patron
Tera Patron

@竜太畠 

you won't get MRVS data using the OOTB Table API on sc_req_item as MRVS data is stored in other table

Another way is this to use Scripted REST API

How to fetch Multirow variables on RITM/SCTASK using REST api 

Another way is to use table API on Multi Row Question Answer [sc_multi_row_question_answer]

check how it's done

Example below

AnkurBawiskar_1-1750771196948.png

 

AnkurBawiskar_2-1750771197032.png

 

AnkurBawiskar_3-1750771196904.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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

@竜太畠 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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