Use of aggregate functions in View

Ravi Krishnappa
Tera Contributor

I've a requirement to send the details from 3 different tables to external system.
Table A:
Column 1: ID
Column 2: Name

Table B:
Column 1: Table name
Column 2: Name
Column 3: state
Column 4: End date

Table C:
Column 1: Table Name
Column 2: Name
Column 3: backup duration

Table A and B is related with 1:N mappings with table name and name
Table A and C is related with 1:N mappings with table name and name

Now Requirement is to send the ID, Name latest end date with state, and latest backup duration.

Solution Proposed: Create a view of 3 tables with left join and add the fields into the View. and then external system call the table API service.

Issues : External system get's multiple records for same ID record. they can use aggregate API for grouping records and use max(end date) and max(update date of table 3) . however this is taking lot of time.
Is there a better solution for creating view that gives us unique record with ID having latest end date of each ID and latest backup duration of each ID.

1 REPLY 1

ServiceNow Tec2
Mega Sage
This has been resolved by ServiceNow Technical Support. Please refer to KB1006377 for more information.