Retrieve MVRS values using OOB REST APIs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 05:29 AM
Hello,
I have a requirement to retrieve MVRS table values using the REST API. I tried looking into the sc_multi_row_question_answer table but somehow I don't have access to view or query that table although I can see the list/table in the task and request and am able to see the required entries.
Shouldn't I already have access since I'm able to view it on the TASK UI but not the table? Also, directly trying to access the table also produces a security restriction.
Is there any way I can get the variable values for the task including the MVRS using the OOB REST APIs?
Thanks,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 05:47 AM
which user you are using? did you try to visit "sc_multi_row_question_answer" directly using this syntax sc_multi_row_question_answer.LIST
are you able to see the data?
you can get the MRVS json if you consume the Table API on sc_req_item table
Another way is this to use Scripted REST API
How to fetch Multirow variables on RITM/SCTASK using REST api
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 06:25 AM
I'm using a user with limited permissions that mostly has ITIL and Event Management role.
Directly trying to access the table sc_multi_row_question_answer gives me "Security constraints prevent access to requested page"
Can you elaborate on how "you can get the MRVS json if you consume the Table API on sc_req_item table"?
I tried to get the sc_req_item with the sysparm_fields including variables.<table_var> but get a blank field as a result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 01:47 AM
you can use scripted REST API for this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 01:59 AM
OOB API will use the authentication user role to fetch these values. If you are using itil or basic role, they will having limited access and not able to access the sc_multi_row_question_answer
var gr = new GlideRecord('sc_req_item');
if (gr.get('<SYS_ID OF RITM>'))
{
// Syntax for this is gr.variables.table_var which returns JSON array value as String
gs.log( "1.variables "+ gr.variables.server_build_list);
}
// Syntax for this is gr.variables.table_var.getRow(<ROW NUMBER [i]>) which returns ith row from the multi row variable
// and we are trying to access a cell out of it as below
var row = gr.variables.server_build_list.getRow('1');
gs.log( "Fetching Row 1 "+ row.u_data_center);
// Syntax for this is gr.variables.table_var.getRowCount( ) which returns current row count
gs.log( "Row Count "+gr.variables.server_build_list.getRowCount())
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0743684