Auto-populate values if there is only one available selection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 10:30 AM
Hi All,
There are three choice type field in problem from A,B and C.
B field values have dependency on A filed value and C filed values have dependency on B field value.
I want to auto-populate values if there is only one available selection in filed both the filed B and C.
For example:
1) Field B populates with value if there is only one option depending on the value in Field A.
2) Field C populates with value if there is only one option depending on the value in Field B.
Thanks.
@
- Labels:
-
Problem Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 10:33 AM
Hi there,
Can you share what you've tried so far? Can you share where you are stuck? Can you share where exactly you need help with?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 01:18 AM
Hi Mark,
Thanks for the reply. I have tried to achieve this through client script but I think that is not the conventional way as I have to write code for each single value which have only one dependency with another filed.
e.g:-
var x = g_form.getValue("field A"):
g_form.setValue("field B", x);
If I am following this way then that would a long script for this solution. Just want to check is there any other conventional way to achieve this requirement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 09:09 PM
This might help you:
- 2021-02-11 Catalog Data Lookup Definition on any table, eliminating Catalog Client Scripting
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 10:48 AM
You can achieve this using Client Script