Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Database view to reference field

ClaireB
Mega Contributor

Hi, 

I'm trying to build a database view from one table (technical service table) to a reference field (PII data) on that table so I can see a many to many list view. 

This is the related list at the bottom of the first table
find_real_file.png

So I want to have a list view of each technical service with each corresponding PII Data name. 

Can anyone help with going about this. 

find_real_file.png

This is what I have so far. But I don't know what the where clause should be? This is my first time doing a database view. I can't find a common field on each of the tables to link in the where clause. Maybe I am doing something wrong. 

Thanks.

1 ACCEPTED SOLUTION

ClaireB
Mega Contributor

I've just realised I might have been looking in the wrong place, and instead created a custom m2m table for what I needed. 

Thanks Ankur anyway for your help!

View solution in original post

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

update your where clause for u_pii_data table as this

pii_source_system = techser_sys_id

Ensure you add Source System field as View Field for PII Data table

Regards
Ankur

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

ClaireB
Mega Contributor

Hi @Ankur Bawiskar 
Thanks for the reply. 

I have added the where clause as you advised. 

I don't have Source System as a field for the PII Data table:

find_real_file.png

Hi,

which field on PII Data holds the reference to technical service table?

You need to use that here

pii_source_system = techser_sys_id

Regards
Ankur

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

Hi,

Here is a record on the PII Data table.

The Source System is the Technical Service name. 


find_real_file.png

But when I try the clause, I get:

find_real_file.png