Reference field dependent on value of another field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2017 09:58 PM
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?
I can find lots of things that talk about dictionary overrides but not a lot that gives practical examples of setting attributes.
Thanks
Chris
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 09:53 PM
That's weird.It does work for me
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 10:07 PM
I'll keep at it tomorrow
Thanks for your help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2021 10:51 PM
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:
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2021 11:15 PM
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!
STEP #2 - I created two field
The first field is the Reference to the "Location" table (the column "1st Rack")
The second column is the LIST type field with a Reference to the "cmdb_ci" table.
STEP #3 - I created some Test Data (2 CIs with Location = "Mexico")
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"
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!
Let me know if that answers your question and mark my answer as correct and helpful.
BR
Dirk