logo

NJP

ServiceNow Things to Know 112: TableUtils()

Import · May 10, 2024 · article

Hello Everyone,

Because of an ask, I was looking for a way to identify a CMDB_CI class hierarchy. Came across this cool API SN provides – TableUtils().

https://developer.servicenow.com/app.do#!/api%5Fdoc?v=newyork&id=r%5FTU-TableUtils%5FS

getTables() interested me because it was exactly what I needed. Turns out the array it returns is a Java Array. Unusable if you’re doing some JS stuff on that array. And, hence it was for the first time, I used j2js(). [Java to JavaScript]. Like jsArray = j2js(jArray);

Have a look at some of the methods provided by j2js - https://developer.servicenow.com/app.do#!/api%5Fdoc?v=newyork&id=r%5FJ2js-j2js%5FO

If you're looking for ways to handle Java object returns in ServiceNow, j2js is here to help!

If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL

Best Regards,

Prashant Kumar (LearnIT)

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635

View original source

https://www.servicenow.com/community/developer-blog/servicenow-things-to-know-112-tableutils/ba-p/2926651