How to write subqueries?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 03:54 AM
How to write subqueries in servicenow?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 03:56 AM
Hi there,
Can you explain your question a bit more?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 03:58 AM
Like we have sub-queries in sql where one queries input is given to other.
Eg select * from table where (some query here)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 04:02 AM
Hi,
There is no direct method to write sub queries. But you can use addJoinQuery of Gliderecord.
Alternative you can do a gliderecord query and fetch the results into an array and then use addQuery with IN operator.
Kindly mark the comment as a correct answer and also helpful if this answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 04:04 AM
Hi Harry,
Go through following link it might help you.
Here you will find an example of addjoinquery.
Please Mark helpful and correct based on impact.
Regards
Nikhil