Database view returns partial results or mismatched row count when joining on a Document ID fieldIssue When you create a database view, you sometimes need to join tables through a Document ID type field. Like Reference fields, Document ID fields let a record reference another record. However, Document ID fields can reference a record on any table, not just a predefined table like Reference fields. A Document ID field stores data in 2 fields: Table Name and Document (sys_id). If you join tables by referencing only the Document field, the database view can return unexpected results, such as partial results or a mismatch between the row count and the results returned. Symptoms The database view returns only partial results.The row count does not match the results returned. Release All supported releases Cause The join references only the Document field of the Document ID field. The Table Name field is not included in the join condition. Resolution To join 2 tables correctly through a Document ID field, reference both fields in the where condition. Hardcode the referenced table name in the condition. For example: To join the Assessment Instance table to the Incident table, note the following 3 fields: Assessment Instance [asmt_assessment_instance] trigger_idAssessment Instance [asmt_assessment_instance] trigger_tableIncident [incident] sys_id The where condition is: inc_sys_id = aai_trigger_id && aai_trigger_table = 'incident'