- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 11:38 PM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 04:25 AM
Hi
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 12:11 AM
Hi,
you can use advanced ref qualifier on that reference field and show the records based on choice.
what did you start with and where are you stuck?
Regards
Anku
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 01:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 01:33 AM
Hi,
I assume in your content table there is some field which holds the choice value; based on that you can filter
javascript:'u_field=' + current.choiceField;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 02:21 AM
Hi
example
Yes i have a choice field called type and choices Test1, Test2, Test3. when i select Test1 from choice field the reference field(Category) it should show options which contain Cloud in there name. if i select choice Test2 then in reference field(category) it should show options that contain Servicenow in there name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 04:25 AM
Hi
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader