Jaspal Singh
Mega Patron
Mega Patron

Consider a scenario where a dashboard has 5 or more reports & all of which use common filter. For instance reports containing a filter of Company along with other filters that may differ per reports but something that is common in all being Company filter. So, comes in a requirement where Users needs to have a Company field filter available on the top of dashboard which would update all the reports accordingly. This though is simple & can be achieved easily if Performance & Analytics plugin is activated but as we know it is licensed & not all customers would opt for we need to come up with something that would be something similar.

This again can be achieved easily by following below steps.

1. Creation of property as below.

find_real_file.png

Only reason for creation of above is to ensure that somewhere there is a selection done so as to ensure all reports on a dashboard are updated accordingly. Write roles: 'itil' is to ensure that all Users with 'itil' role can select company value from Company as a property.

Choices are passed as Company1='sys_id', Compay2='sys_id' reason being label Company1 will show up for selection of choice list while its actual value is sys_id for reference.

Only sys_ids would work but selection then would be a difficult ask & thus labels would help. Property once added & saved can have a New category created & then can be further called in the Application Module that will be created. So in our case, with above property a new category: Select Company is created which is as below.

find_real_file.png

 

Once saved, created property will get associated automatically.

2. Once done a new Application/Module can be created as below.

find_real_file.png

With a below configuration for Properties.

find_real_file.png

where sysparm_category=Select Company is same as the Category created above.

3. Creation of script include which will be called in all reports of the dashboard.

find_real_file.png

4. Call the above script include in report with below format in the filter.

Company IS javascript: new company_report().companyis();

Considering report is created on a table that has a Company field which is a reference field.

 

5. How does this work?

a. User goes in looks for Report - Company >> Properties from Application Navigator.

b. Gets a selectbox from which Company can be selected (Company1, Company2, etc. as documented in point 1).

c. Company selected being a value is updated in the property & thus is passed on to Script include's function: companyis()

d. This Script include & function is further called in report with format as mentioned in Step 4.

e. So, a dashboard having 5 reports with company filter as common with implementation of above would lead to update of all reports when dashboard is acessed thus making it dynamic

 

Though our primary goal should be to get Performance & Analytics in place as it has exceeding results but there may be cases where this can be a need of a hour & has a deliverable associated (client not agreeing for P&A) which would ensure that ServiceNow is a complete customizable tool with which desired results can be expected & obtained at any point in time.

 

Hope this Helps!

 

Thanks,

Jaspal Singh

2 Comments