Filter on a view is not working

Meskandar
Giga Contributor

The view (see screenshots) is simple, one table, with a filter on active=false

  • Running the view includes records with status active=true in spite of the filter.

What is going on? 

Thank you for your help.

1 ACCEPTED SOLUTION

Juhi Poddar
Kilo Patron

Hello @Meskandar 

You are creating a database view in ServiceNow to join tables using a WHERE clause. A database view is not used for filtering records directly but serves a different purpose:

  • Its primary role is to create a virtual table that combines data from multiple tables into a single, unified view.
  • This view can then be utilized for various purposes, such as reporting, dashboards, or integrations.

Use Cases for a Database View:

  • Creating complex reports by joining related data from different tables.
  • Aggregating data for dashboards.
  • Providing a unified data source for analysis.

To learn more about database views and how to create them, you can explore the following topics:

Additionally, when working with views in tables, these are used to filter columns for a specific table view. This is separate from the functionality of database views, which focus on combining data across tables.

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Meskandar 

database view is used to join 2 tables, but you have only 1 table i.e. sys_user

what's your business requirement here?

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

I will add other tables, going step by step, filtering the first table then joining to another...

@Meskandar 

Thank you for marking my response as helpful.

As pew new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

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

Juhi Poddar
Kilo Patron

Hello @Meskandar 

You are creating a database view in ServiceNow to join tables using a WHERE clause. A database view is not used for filtering records directly but serves a different purpose:

  • Its primary role is to create a virtual table that combines data from multiple tables into a single, unified view.
  • This view can then be utilized for various purposes, such as reporting, dashboards, or integrations.

Use Cases for a Database View:

  • Creating complex reports by joining related data from different tables.
  • Aggregating data for dashboards.
  • Providing a unified data source for analysis.

To learn more about database views and how to create them, you can explore the following topics:

Additionally, when working with views in tables, these are used to filter columns for a specific table view. This is separate from the functionality of database views, which focus on combining data across tables.

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar