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

Creating a dependency for a reference field on choice field

vishnu prasad1
Giga Contributor

Hi Developer's,

I have to create a dependency for a Reference field on to the choice field for Example if i select a particular choice then related items to that choice should show up in reference field and this table on which am working is shared with other applications as well, so I don't want this changes to reflect to other or Create any issue to developer working on other applications. if script can help, provide give a reference.

Thanks in advance 

1 ACCEPTED SOLUTION

Hi @vishnu prasad 

then use this

1) ensure you use correct choice field name and correct choice value for comparison

2) ensure you give correct name field from the Content table

javascript: var query; if(current.u_choice == 'Test1') query = 'nameLIKECloud'; else if(current.u_choice == 'Test') query = 'nameLIKEServicenow'; query;

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

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

View solution in original post

10 REPLIES 10

Maciej Kowalski
Kilo Expert

Hi, check this out. I think it could help you:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0785188

Hi @Maciej Kowalski ,

Thanks for your kind response, am looking to create dependency  for reference field not for choice field, here i want to achieve related options which will show up in reference field that are dependent on choice list.

 

Ankita19
Tera Guru

Check this Video:

https://www.youtube.com/watch?v=jiR4DjpmlRM

Hi @Ankita ,

Thanks for your kind response, need help in showing related options in reference field dependent on choice field