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

@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

@ShAn21 

I hope I have provided a thorough answer to your question. I'm confident that with your developer skills, you can take it further from here.

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

Thanks Ankur for taking your time out to answer this. I am a bit surprised that we do not have API covered to get details in Service Catalog (sn_sc) API. What's your opinion?

 

Thanks

Hi @Ankur Bawiskar 

There is one issue I am facing here. I see the read role for multi row variable is sn_request_read and the API user also has the role. But I am getting the below error

 

{
    "error": {
        "detail": "Field(s) present in the query do not have permission to be read",
        "message": "Insufficient rights to query records"
    },
    "status": "failure"
}

@ShAn21 

Are you sure it's failing due to ACL?

Did you check with Access analyzer and that API user?

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