Create left join in Database view and filter on specific company name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 02:46 AM - edited 04-05-2023 03:21 AM
Hi Experts,
I am new to ServiceNow, and I am trying create a database view such that it is a left join between user and group. I managed to achieve a join but I want the result to display users with company in "ACME North America" only. As of now it display all users with their associated companies (even if they don not as well), but I only need it to filter on "ACME North America" only. I have provided the screenshot of what I have created in ServiceNow database view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 02:49 AM
Hi @Muradz1234567 ,
Please see this community post from 2018 which talks about filtering a database view which is similar to your requirement: https://www.servicenow.com/community/itsm-forum/how-to-add-filters-in-the-database-view/m-p/486623
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 03:18 AM
I came accross that post before posting my question. Sorry I did not find that post useful in my case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 03:28 AM
Hi @Muradz1234567 ,
To explain a little further, in the where clause you are putting in the e.g. from the other article:
ch_name = 'cmdb_ci' && ch_element='operational_status'&&ch_value=6
ch = current table
_name = current field
cmdb_ci = joining table
&& = "and statement"
_element = current field on current table = "filtered value"
_value = current field on current table = "filtered value
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/