- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 06:51 AM
Hello now-sdk community,
I'm having some troubles making joinQuery to work in a now-sdk Typescript script.
For a specific need, I need to be able to make a join between two tables (with a 0-n relationship).
I'm able to achieve that without issue using a background script, this way
var firstGr = new GlideRecord('firstTable');
var secondGr = woGr.addJoinQuery('secondTable');
firstGr.addQuery('u_field', 'filteredValue');
secondGr.addCondition('u_second', 'anotherValue');
secondGr.addCondition('u_third', 'aThirdValue');
firstGr.query();
while(firstGr.next()) {
gs.info(firstGr.u_field);
}
But, when I try to write this code in my now-sdk Typescript based project (using @Servicenow/glide dependency on version 26.0.1), this code is not recognized by my IDE (the "secondGr.addCondition" doesn't seem to exist).
After some research, it seems that the typing provided with now-sdk glide dependency does not reflect the actual signature.
The Xanadu documentation tells us that the addJoinQuery instruction is returning a GlideQueryCondition object, but in the now-sdk lib, this is a IQueryCondition that is returned (and this interface has no members).
Has anyone ever managed to make join queries to work in a now-sdk project using Typescript?
Thanks for your time!
Anthony
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 08:56 AM
Sorry about this, we will log a bug to get this fixed in a future version. For now you might just have to use //@ts-ignore above those calls to surpress the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 08:56 AM
Sorry about this, we will log a bug to get this fixed in a future version. For now you might just have to use //@ts-ignore above those calls to surpress the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 09:10 AM
Hello @BryceG , thanks a lot for a quick reply.
That's what we did waiting for your answer 🙂