The CreatorCon Call for Content is officially open! Get started here.

Get variable values from RITM via API

ShAn21
Tera Guru

Hi Team,

I have a requirement where the client wants to get all the variable values by sending the RITM number.

 

Do we have any OOB APIs available right now to fetch all the catalog variables from a RITM. I dont see any option in the sn_sc service catalog API. Is table API a feasible Option?

 

Thanks

1 ACCEPTED SOLUTION

@ShAn21 

I tried to get MRVS using this syntax variables.variableSetName , but it returned empty

AnkurBawiskar_0-1741089778632.png

 

1) So let them use Table API for normal variables on RITM table

2) Then inform them to use Table API on sc_multi_row_question_answer table with filter as Parent=RITM SysId

3) Then will get RITM sysId in the 1st call so they can use it in 2nd API call

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

12 REPLIES 12

Looks like it's not the ACL. It shows passed in access analyzer. Any idea what could be the issue?

Najmuddin Mohd
Mega Sage

Hello @ShAn21 ,

You can get all the variables by using the OOB script include just by passing the RITM and adding it to the Scripted REST API.

new global.GlobalServiceCatalogUtil().getVariablesForTask(ritmGR, withMRVS /*boolean*/)



NajmuddinMohd_0-1741152893170.png


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

Thanks Najmuddin. This is great.

But for my current case I wont be able to use it as our customers are pushing us to use OOB API as much possible.