The CreatorCon Call for Content is officially open! Get started here.

Dynamic titling on drill down reports

johnfeist
Mega Sage

I have a report with a couple of drill down layers.  The initial report has bars, the first level drill down a doughnut and the third level is a list.

I can give the first two individual names in the Style tab.  I can't do the same for the list because the Style tab is greyed.  Is there a way around that?

My real question is this.  In the top level report, if I click on a bar that is labeled Help Desk, I want the doughnut that opens to include Help Desk in the title I have set for that report.  I know that the data are being captured in order to set up the filtering.  How can I add the higher level choice descriptor to the drill down title or do I need to propose a SN enhancement?

Thank you for any information you can provide.

:{)

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster
9 REPLIES 9

Hey johnfeist,

Sorry for the misinterpretation. Since the reports are just a series of tables on the [sys_report] table, you should be able to grab the title values of each drilldown and add/subtract text from there. The most important tables to do this are:

[sys_report]

[sys_report_drill]

The report table has a field called 'report_drilldown' that references the [sys_report_drill] table. This drilldown table holds the title value of your drilldowns - the field that holds the name is called 'title'. Here's an example:

find_real_file.png

I have a report called 'dog breeds' and two drilldowns called 'Centers' and 'Administrator: 2019-06-18'. You can create a UI Action that queries the [sys_report] table and grabs the 'report_drilldown' field value and modifies it.

Heres a background script that does this. Of course you'll probably want to implement this code in a different way but it gives you an Idea of how it should work:

find_real_file.png

Since the 'report_drilldown' is a reference field and not a list field, this field won't give you all the child drilldowns. You'll have to dot walk to get the next nested drilldown. That's what's happening on line 5. 'This is the output:

find_real_file.png

Upon clicking your UI Action, the script will give you all the drilldown titles (in this snippet, I also have the title of the main report) and you can append any text you feel necessary to each drilldown title.

Hope this helped! 

 

Thanks US_3_R,

That makes for interesting reading.  Unfortunately, reporting is its own portal so I'm not seeing how I can utilize what you demonstrated as part of running a particular report.

I think we've taken this one about as far as it can go.

:{)

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Did you ever find an answer for this?

Chuck Tomasi
Tera Patron

While dynamic titles are not currently available, I might suggest you look at making an interactive filter on the dashboard or homepage. Then it becomes quite clear if the user is viewing all records or a subset (based on group, priority, etc.) It also reduces the number of reports you have to build because they can tweak the general ones to get more specific insights on demand.

Interactive Filters on homepages and dashboards | ServiceNow Docs

Thanks Chuck, I'll give it a try.

:{)

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster