- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-10-2022 07:20 AM
There was a time some years ago where ServiceNow offered the version 3 for record lists, but today "List v3 is no longer available for new deployments" (see List v3 administration). I can imagine that there are customer instances which still have activated the version 3. If you don't know which list version you have in your instance, you can read the Comparison of List v2 and List v3.
One cool feature of lists v3 that still lives on, are the so-called "Related List Conditions", which are only available for the Report Builder. At least that's what I thought until I accidentally opened a form for Breakdown Sources and was very surprised to find Related List Conditions there:
If Related List Conditions still work outside the Report Builder, there must be some way to utilize that, I thought.
But first, there is an interesting question to be answered.
How exactly can the extended Condition Builder be activated?
The answer to this question is provided by the Dictionary entry of the field "Conditions" for Breakdown Sources:
The attributes of interest are
- condition_builder=v2
- allow_related_list_query=true
So if this works for Breakdown Sources, does this also apply to other condition fields in the platform, for example Business Rules?
Yes it does! OOTB it is possible to cancel a Problem if it still has open Problem Tasks. To prevent this, the common pro-code approach would be to GlideRecord in a Business Rule the problem_task table in order to check whether there are still active records for the related Problem and if so abort the save/update action. But with the activated Condition Builder v2 (add the mentioned attributes to the field "Filter Conditions"), you can come to the same result without coding and just by configuring a Related List Condition:
As a result, the Cancel action is prevented if there are still open Problem Task records:
And what is the magic behind the Related List Conditions?
A look at the stored encoded query answers the question:
The well-known encoded query is extended by a new part reflecting the Related List Condition:
RLQUERY | problem_task.problem | >=1 | ^active=true^ | ENDRLQUERY |
boundary identifier for the beginning of a Related List Condition | table name of related list and field name that references the parent record | number of matching occurrences for the following condition | filter condition for the records of the Related List | boundary identifier for the end of a Related List Condition |
To test out that new encoded query portion, it is not necessary to build a respective URL by yourself. Instead, use the Preview button (1) and click on the link with the number of matching records (2) right beside that button:
With the above configuration on the change_request table I wanted to find all Change Requests which have at least one referencing Change Task:
The resulting list represent exactly what was expected, but in the above screenshot you can also recognize some restrictions:
- You cannot use anymore the NLU search as well as the filter feature.
- You cannot save the query for later use.
- It is not possible to use the search fields in the table header.
- And additionally, there is no export option offered anymore.
So what else can we leverage on a list view with Related List Conditions?
For example, you still can create a Visual Task Board from the resulting list:
Can the extended encoded query be used for scripting?
Yes, it can! Right-click on the breadcrumbs part "Related List condition..." and copy the query into the clipboard:
The script returns exactly the same Change Request records as the list before:
With the classical approach, the script would be much more extensive!
What's your opinion? Can you think of any other possible uses? If so, feel free to leave them in the comments.
And if you want to see some more practical use cases for Related List Conditions I recommend the following video from
- 7,704 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I did a video on using related list conditions for reporting, but I didn't stop to think about the scripting implications. Seems to me you may want to script for the same reasons you'll want to report. Thus you'd need something to capture the conditions in an encoded query.
Anyway... here's the use cases I mention in my video.
INCIDENT MANAGEMENT
Incidents with Breached SLAs
Incidents with SLAs that are close to breaching.
Incidents with more than 1 SLA breached
Incidents with used Knowledge Articles
Incidents with used Knowledge Articles that have been flagged
Incidents in past X days affecting critical business services.
Incidents with child Incidents
PROBLEM MANAGEMENT
Problems with child Incidents P2 and above
Problems with more than 10 Incidents
Problems with Changes Planned in the next X Days
KNOWLEDGE MANAGEMENT
KB Articles with Feedback
Flagged KB Articles with Feedback
KB Articles with no Usage
CHANGE MANAGEMENT
Changes impact critical business services?
Changes past planned end and have open Change Tasks?
Changes in authorized state with open Approvals
Changes with more than X Incidents Fixed by the Change.
Emergency Changes with pending Approvals
Changes where I have a Change Task
REQUEST MANAGEMENT
Request Items that are open but have no tasks
Request Items with more than 1 open catalog task
Request Items with approvals older than 10 days
Request Items older than X days with open catalog tasks
Request Items past delivery date where I have a Catalog Task
DEMAND MANAGEMENT
Demands with Baselines older than 60 days
Demands with no Baselines
Demands with no Risks
Demands with any Risks with Absolute Probability
Demands where I am a Stakeholder
Demands with Cost Plans in next year's fiscal period
Demands with Cost Plans over $X
PROJECT MANAGEMENT
Project with Project Tasks past planned start but still in planned
Projects where my groups have project tasks.
Projects with SubProjects that are overbudget
Projects with Stories not yet in a Sprint
Projects with Resource Plans starting in <30 days that aren't allocated
Projects with Cost Plans over $X planned in the next 60 days
Projects with Benefit Plans planned in the next 60 days
Projects with no baselines
Projects with no baselines in the past 30 days
Projects with no Status Reports in the last 10 days
Projects with Absolute or High Risks
Projects with P1 Issues created last 10 days & still open.
Projects with pending Decisions >10 days old
Projects with Change Requests beyond planned start & still planned
Projects where I'm a stakeholder
Projects where my groups have ProjectTasks/Stories/Test Instances
Projects with unapproved Time Cards
Projects with unprocessed Expense Lines created in past 10 days
RESOURCE MANAGEMENT
Resource Plans starting <30 days where user allocations are only confirmed
USER ADMINISTRATION
Users who have the admin role
Users who have the impersonator role
Users who have roles but are not in groups
INTERNAL RELATIONSHIP MANAGEMENT
Users who have delegates with open end dates
Users who have more than 10 open Incidents
Users who have more than 10 open Request Items
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
It is reference qualifiers where I use RLQUERY (and/or SUBQUERY): it often replaces - as you say - extensive scripts with a simple encoded query.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Maik Skoddow ,
I have a similar requirement but not able to get this done in Utah.
We need to add related list conditions in story table or add a column in sprint planning tab for checking values from scrum task state of a story. For e.g., stories in sprint planning tab should show the active scrum task state.
Please suggest any possible ways to get this done.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Have you verified that the Breakdowns actually work with this?
I tried doing the same thing for indicators (additional conditions) and it definitively did not work.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Uncle Rob
No, nothing worked for me.
Neither in BR nor anywhere else, still struggling to get this working.
Most importantly I need it on Personal Backlog table to filter with related list conditions.
Thanks,
Vivek
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Maik, this came in really handy for helping identify large quantities of junk duplicate records for deletion. Thank you for the info!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Mark,
Thank you for the articles!
I successfuly activated the condition builder v2 for BusinessRule. But I can't make it work with the extended_operators attributes to keep the "changes", "changes to" and "changes from" options
Do you have any suggestion or solution?
The condition builder v2 with the related list conditions is amazing! But loosing the "changes" options is a big loss.
Regards,
Mathieu