- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 04:57 AM
Hi,
1. After creating a database view , adding the tables you want to combine , how to define where clause?
2. How do we know which one to write where clause for??
3. For example, see the picture below,
- How to judge where to write the Where clause? as in where clause is written near the change_request and not task_sla
- Why was it written in change request where clause?
- Why did it not use change_request_sla table n used task_sla table??
Please share any article, blog or videos if you have.
Thanks,
Vaishnavi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 06:43 PM
Hello @vishnumaaya
Please refer below thread & videos:
Solved: Database View - ServiceNow Community
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0719186
https://www.servicenow.com/docs/csh?topicname=c_DatabaseViews.html&version=latest
https://youtu.be/_JY462TmXxU?si=2OvPCBW_Ecid4flE
https://youtu.be/vk1MYBxTSxY?si=j-Y1f0BFCdknobJT
https://youtu.be/vJo3BG2RCVc?si=Apuspc_SFU12gBbD
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 05:35 AM
Explanation here:
1) row 1 is for change_request, it should be with 100 order
2) row 2 is for task_sla, it should have where clause and should be with 200 order
You can write where clause in any row but ensure it's correct with correct prefix
- Why did it not use change_request_sla table n used task_sla table?? -> this might be as per customer requirement as SLAs are stored in task_sla table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 06:50 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 01:37 AM
Hi ,
This is not created by the client but OOB one, I just selected this as an example only!
why is order important in database view?
Thanks,
Vaishnavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 05:38 AM
Hi @vishnumaaya
- How to judge where to write the Where clause? as in where clause is written near the change_request and not task_sla
Atul: it is mainly on main table like where is main record exists.
-
- Why did it not use change_request_sla table n used task_sla table??
Atul: The Sla stored in task_sla table and i.e. reason we use task_sla.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0719186
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************