Columns not showing as defined on the view table for database view on 2 tables

Snehal13
Kilo Sage

I have the database view on 2 tables and defined the view table incident and added columns from the available list that should show on the view result but not seeing chosen columns.

6 REPLIES 6

mohdarbaz
Kilo Guru

Hi @Snehal13 ,

 

This can happen due to several reasons.
Here are some steps and considerations to help you troubleshoot and resolve the issue:

1, Check Column Definitions: Ensure that the columns you have added to the view table are correctly defined and mapped to the corresponding columns in the underlying tables.

2, Verify Join Conditions: Make sure that the join conditions between the two tables are correctly specified. Incorrect join conditions can lead to missing or blank columns in the view result.

3, Add Fields to View Fields: Ensure that the fields present in the WHERE clause are also added as view fields under that view table. This is a common issue where fields used in the join conditions are not included in the view fields, leading to missing data.

4, Refresh the View: If the underlying tables have been modified (e.g., columns added or removed), you may need to refresh the view to reflect these changes.

5, Check Permissions: Ensure that you have the necessary permissions to access the columns in the underlying tables. Lack of permissions can result in columns not being displayed in the view.

 

Example:

I have configured a database view by utilizing two tables, such as incident and task, and to see the chosen columns, you might need to ensure the following.

 

Join conditions:

SELECT
    incident.number AS incident_number,
    incident.short_description AS incident_description,
    task.number AS task_number,
    task.state AS task_state
FROM
    incident
JOIN
    task ON incident.sys_id = task.incident_id
WHERE
    task.state IN ('Closed', 'Open');
 

Add Fields to View Fields:

Ensure that incident.sys_id and task.incident_id are added as view fields under the view table.

Missing Columns: If columns are missing, verify that they are included in the SELECT statement of the view definition.

Blank Columns: If columns are blank, check the join conditions and ensure that there is matching data in both tables.

 

Troubleshoot step by step, hope this solves your issue.

 

Regards,

Mohd Arbaz.

My view table is incident and other table is sc_task. How to add incident.sys_id and sc_task.incident_id

Ankur Bawiskar
Tera Patron
Tera Patron

@Snehal13 

share the screenshots.

Did you add those fields in view fields related list for that view table?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Yes Ankur. Added those fields in view fields related list for that view table but the result has no display of those fields