Show Duplicate relations records in report

Pallavi65
Tera Contributor

Hi all,

 

I want to create a report on 'CI Relationships' table showing the records which are duplicate. Like, same Parent and Child relationships (more than 1) has to be shown. Like, in CI relationships table, if more than one record is there (Same Parent and Same Child) then it has to be shown up in the report.

 

Can someone give me code for this?

 

 

Thanks in Advance.

 

 

Regards,

Pallavi

 

1 REPLY 1

Punit S
Giga Guru

Hi Pallavi -  Here's is the solution with the steps/code for the report you are looking for.

 

  1. Navigate to the Report module in ServiceNow.

  2. Click on the "New" button to create a new report.

  3. In the "Report Type" field, select "List".

  4. In the "Table" field, select "CI Relationships".

  5. In the "Filters" section, add the following filter condition:

    • Filter: Parent
    • Condition: is not empty

    This will filter out any records where the Parent field is empty.

  6. In the "Group By" section, add the following group condition:

    • Group: Parent
    • Order: Ascending

    This will group the records by their Parent field value, and sort them in ascending order.

  7. In the "Metrics" section, add the following metric:

    • Metric Type: Count
    • Table: CI Relationships
    • Field: Child
    • Aggregate: Count
    • Alias: Duplicate Count

    This will count the number of duplicate Child values for each Parent value, and display the result in a column named "Duplicate Count".

  8. Save the report.

This report will show you all the records in the CI Relationships table where the Parent field is not empty, grouped by Parent value and with a column displaying the number of duplicate Child values for each Parent value. Any Parent values with a Duplicate Count greater than 1 will indicate that there are duplicate records with the same Parent and Child values.

 

Please like or mark the solutions proposed. 

 

Thanks,

Punit