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.

Using the Table Rest API and Joins

GloriousWater
Giga Contributor

Hi community. 

I am using the Table REST API to extract the following tables:
sc_req_item,

sc_item_option,

sc_item_option_mtom

Is there a way, in the filters that I can join and filter on all 3 tables in one api call?
e.g. Get all requests made by x-user, for a specific item category, and for that category get the rows from mtom for 2 list-values ? 

Im struggling a bit with dotwalking and also saw a post https://www.servicenow.com/community/developer-forum/rest-api-and-a-quot-get-quot-function-of-a-join... that mentions joining through the API. but when doing some, either no rows are returned, or some rows but fields from the task table.

 

Best regards

GloriousWater

2 REPLIES 2

Sukraj Raikhraj
Kilo Sage

Have you tried a script rest api? This should allow you to queries the table and return the response needed. https://docs.servicenow.com/bundle/tokyo-application-development/page/integrate/custom-web-services/...

 

I am familiar with the "regular" rest api. I can query each table and then do the join, but I want to reduce the amount of data queried that will be excluded after the join. e.g. join serverside, then return the results. Its unclear to me how I do that with the script api.