Dashboard report doesn't show any record

Community Alums
Not applicable

Hi experts, 

I have a report on my dashboard of type score. Now I used a script to return the sys_ids that I want, the issue is I'm getting all the sys_ids but the count remains 0. Does anyone know what's going on with my script or report filter (report also follows interactive filter, just mentioning).

I have attached the screenshot of my report and also the script include.

Then I also used "sys id is javascript: new scriptName().function()" in screenshot report 2

Thanks in advance!

1 ACCEPTED SOLUTION

Hi @Community Alums 

Agree, in this case what I suggest

 

let's try to build this report on list view first and see how many records in this year and last year. This will help us to see what wrong we are doing.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

10 REPLIES 10

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Community Alums 

 

Which table you are creating this report and why using sys_id?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Community Alums
Not applicable

Actually its a custom table and Im using sys id because I dont know what else to do, because I need records which were completed this year or closed this year or which are pending but submitted for review on this year. When I used filter, I used 1 criteria for completed records, 2nd criteria for closed records and 3rd criteria for pending records but for pending records I had to use related list condition, but it seems to affect all other conditions before that and I was getting less count so I tried using script.

 

Hi @Community Alums 

 

 

Actually its a custom table

Atul: Okay.

 

Actually its a custom table and Im using sys id because I dont know what else to do, because I need records which were completed this year or closed this year or which are pending but submitted for review on this year.

Atul: How you are storing completed information, means in which field. Use that in report.

Pending - I am sure you are using state.

 

When I used filter, I used 1 criteria for completed records,

Atul: Okay to go.

2nd criteria for closed records and 3rd criteria for pending records but for pending records I had to use related list condition,

Atul: Why related list ? What value you are storing there.

but it seems to affect all other conditions before that and I was getting less count so I tried using script.

 

 

Atul: @Community Alums  Do one thing, take a pen and paper and try to draw a condition with fields name and for operator you can use SN like Incident example

LearnNGrowAtul_1-1703778832070.png

 

and with this add State AND or OR as per requirement. Build the report step by step. It will be surly done mate.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Community Alums
Not applicable

Hi Atul, first of all thank you for taking the time to help me out.

I try to explain the issue as well as I can...

So before using the script I used the filter and they are as follows (here 1,2 3 are for widget 2 and 3, and the sum should be larger than it shows on the total).

1. Condition 1 and 2 are both for closed records for the current year.

Navdeep_rahiya_0-1703786120963.png

2. Condition 3 is for records that were completed for this year.

3. Condition 4 is for the records which are pending only for the current year.

Navdeep_rahiya_1-1703786292336.png

and for condition 4 I don't have a particular date that will give me correct answer everytime because I have 2 fields called "last case submission date or last case review start date" but for some cases both are empty (especially cases which were migrated, I'm not sure since I haven't worked with the record migration for this app).

So in the  4th condition I have to use the related list like this

Navdeep_rahiya_2-1703786903152.png

These are my widgets

Navdeep_rahiya_3-1703787014734.png

 

1. Pending exclusion (all cases including all prior years too, but we only want this years cases)

2. Complete cases( status is approved)

3. Closed (status = Closed/denied)

4. last year exclusion in review( which were pending last year but might have completed/closed or still pending for this year)

5. Is the total (which is 1+2+3-4 = 5)

but as you can see the total of report 2 and 3 (which is closed and complete cases) the count is greater the total (at this point its missing 15 pending cases for this year).

 

My guess is the related list condition is also applying to the other conditions in the OR criteria.