The CreatorCon Call for Content is officially open! Get started here.

List Reference Field dependant on another Reference Field

Omnia Ameer
Tera Contributor

Hello,

 

I would like to have one list reference field dependent on another reference field . I would like the 'Component' reference field to only show values that are related to the 'Product Name' so when I click on the 'Component' lookup, I only want to see the values related to Product Name which I selected immediately so I think this can be done using client script but how can I set the list Reference Field values??

1 ACCEPTED SOLUTION

If this is in the platform then you can use JavaScript in your advanced reference qualifier and the “current” object.

 

javascript: “u_product_name=“ + current.u_product_name

View solution in original post

11 REPLIES 11

Manmohan K
Tera Sage

Hi @Omnia Ameer 

 

You can use advanced reference qualifier to filter records that you want in the other Reference field based on selection in first reference field

 

You can read below article to know in detail about it -

https://www.servicenow.com/community/itsm-articles/reference-qualifier/ta-p/2306509#:~:text=5.0%20Ad....

Hi Manmohan,

Iam already using the advanced reference qualifier but what I don't know how to implement is getting the value of the first field as the value I got is the one in the database but when I change it in the form it's still not recorded in the database.

For example: if the first refrence field value =X and I change it to Y the value I got in the script is X here's the problem.

So how can I get the value I add in the form for the first field.

If this is in the platform then you can use JavaScript in your advanced reference qualifier and the “current” object.

 

javascript: “u_product_name=“ + current.u_product_name

Hello  @Manmohan K ,@Mike Rakvica1 ,

it doesn't work because current.u_product_name gets the value saved in the field but i need the value i just update the field with it and still not saved the form :

what i know the only thing which detect the change on the field is the on change client script but i don't know how to set the list of the list reference field or how to get this value in script include ?