Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Getting referencing tables via API

AleksaStojanov
Tera Contributor

Hi all,
Is there a way to get referencing tables via API?

AleksaStojanov_1-1708337702137.png

Thanks in advance!

1 ACCEPTED SOLUTION

Tai Vu
Kilo Patron
Kilo Patron

Hi @AleksaStojanov 

Let's give the Table API a try.

GET https://<your_instance_name>/api/now/table/{tableName}

 

Basically you can query to the Dictionary [sys_dictionary] table to retrieve all the entries that referencing to the Stockroom [alm_stockroom]. So in your case the API is like below.

https://<your_instance_name>/api/now/table/sys_dictionary?sysparm_query=internal_type=reference^reference=alm_stockroom&sysparm_fields=name

Timi_0-1708339285622.png

 

 

Cheers,

Tai Vu

View solution in original post

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @AleksaStojanov 

 

I doubt we have any direct way to do , but we can use the records of these tables. What is use case of refereeing table via API.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Tai Vu
Kilo Patron
Kilo Patron

Hi @AleksaStojanov 

Let's give the Table API a try.

GET https://<your_instance_name>/api/now/table/{tableName}

 

Basically you can query to the Dictionary [sys_dictionary] table to retrieve all the entries that referencing to the Stockroom [alm_stockroom]. So in your case the API is like below.

https://<your_instance_name>/api/now/table/sys_dictionary?sysparm_query=internal_type=reference^reference=alm_stockroom&sysparm_fields=name

Timi_0-1708339285622.png

 

 

Cheers,

Tai Vu