Reference field dependent on value of another field

Celliven
Giga Expert

I know this is a 101 question, though I am having a mental blank.

I have added a reference field of configuration items [cmdb_ci] to a form and I want it to offer choices based on the value of another field   1st Rack [u_1st_rack], which is linked to Locations [cmn_location].

I want to specify a location in 1st Rack, then have Configuration Items only display CIs that are in the location specified.

I have set the dependency, but am not sure if it is the Attributes I need to set or a Dictionary override?

find_real_file.png

I can find lots of things that talk about dictionary overrides but not a lot that gives practical examples of setting attributes.

Thanks

Chris

13 REPLIES 13

That's weird.It does work for me


Regards
Harish

I'll keep at it tomorrow


Thanks for your help


DirkRedeker
Mega Sage

Hi

Instead of using the "depending" field definition, you can use a Reference Qualifier to achieve your goal.

I wrote an article on that, and hopefully that will guide you through.

Just have a look at my article here:

https://community.servicenow.com/community?id=community_article&sys_id=834ebd4bdbb4d0901cd8a345ca961...

Article #4 - Depending Reference Fields - using Reference Qualifier

Let me know if that answers your question and mark my answer as correct and helpful.

BR

Dirk

 

DirkRedeker
Mega Sage

Hi

Anyhow, I wanted to know, if I can make it with a simple Dependend Field as well. Below, you can see the steps I took to replay your scenario.

I guess this will meet your requirements:

 

BTW: You do not need to set extra attributes to achieve what you are asking for in your question!

 

STEP #1 - I created a Custom Table similar to yours

This is a custom table in Global Scope!

find_real_file.png

 

 

STEP #2 - I created two field

The first field is the Reference to the "Location" table (the column "1st Rack")

find_real_file.png

find_real_file.png

 

 

The second column is the LIST type field with a Reference to the "cmdb_ci" table.

find_real_file.png

find_real_file.png

 

STEP #3 - I created some Test Data (2 CIs with Location = "Mexico")

find_real_file.png

 

 

 

 

STEP #4 - I created a new Record in the new custom table

Having NO Location selected in the "1st Rack" field, I can see ALL CIs listed in the Reference List for the "Affected CI"

find_real_file.png

 

As soon as I capture some Location in the "1st Rack" field, the Reference List for the CIs is limited to all CIs with the given Location!

find_real_file.png

 

Let me know if that answers your question and mark my answer as correct and helpful.

BR

Dirk