Database View Where Clause

Yanal
Giga Guru

Hello everyone! 

I need help with the where clause for this database view 

I want All requested items, catalog tasks connected to the requested items and the SLA connected to the catalog task! 

how can I achieve this ?

screenshot is also attached!

thanks a bunchfind_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please update the below:

1) change the order of the view tables

2) use where clause as per screenshot

3) ensure you add below fields for view fields in respective view tables

Screenshots below:

find_real_file.png

RITM View Table Fields:

find_real_file.png

Catalog Task View Fields:

find_real_file.png

Task SLA View Fields:

find_real_file.png

When you do try it; add these columns using gear icon:

find_real_file.png

Output:

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please update the below:

1) change the order of the view tables

2) use where clause as per screenshot

3) ensure you add below fields for view fields in respective view tables

Screenshots below:

find_real_file.png

RITM View Table Fields:

find_real_file.png

Catalog Task View Fields:

find_real_file.png

Task SLA View Fields:

find_real_file.png

When you do try it; add these columns using gear icon:

find_real_file.png

Output:

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Brilliant, I just want to add that I made left join true on Catalog task and SLA so I can get all requests even if they do not have tasks in them

Hi,

Okay on which table you made left join as true?

Also does it make sense showing all requests even if they don't have sc tasks in them

Regards
Ankur

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

I made left join as true on both the SLA and Catalog task.

 

In my case I needed to show all requests for reporting purposes because Tasks are created after some approvals 😄