We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

I was trying to combine three tables and planning to build a database view

Sathwik1
Tera Expert

I was trying to combine three tables and planning to build a database view, please check below and confirm what I did wrong?

Sathwik1_0-1770651282697.png

When I click on trynow, getting below error.

Sathwik1_1-1770651308673.png

 

 

@Ankur Bawiskar 

8 REPLIES 8

Sathwik1
Tera Expert

Hi @Sathwik1 ,

To fix the error in your ServiceNow database view (u_kb_user_criteria_view), you must correct the syntax and logic of your Where clauses. Based on the screenshot and common ServiceNow configuration errors, you have two primary issues.
 
The Fix: Corrected Configuration

The error occurs because your Where clause uses underscores (e.g., uc_sys_id) instead of periods to reference fields, and the join logic for multiple tables needs to be chained correctly. 
Update your View Tables related list to match this configuration:
 
Table Order Variable prefix Where clause Left join
user_criteria100uc(Leave Empty)false
kb_uc_can_read_mtom200ucreaducread.user_criteria = uc.sys_idtrue
kb_uc_can_contribute_mtom300uccontributeuccontribute.user_criteria = uc.sys_idtrue

Please try the solution above if that is useful for you please markit as helpful and accept the solution to close the thread.

Regards,

Sagnic

Chaitanya ILCR
Giga Patron

Hi @Sathwik1 ,

Try using the "   .  "  instead of the " _ " like (ucread.user_criteria=uc.sys_id)

 

did you add any view fields to the view tables?

if yes make sure the fields used in the where clause are included

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

Now it's fine, but I don't see any data in the table.

 

Yes, I added views.. screenshot below.

Sathwik1_0-1770654068411.png

 

 

Sathwik1_1-1770654085256.png

 

@Chaitanya ILCR please help