Auto-populate values if there is only one available selection.

Rakesh Behera
Tera Contributor

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.

@Ankur Bawiskar 

@Aman Kumar 

@Jaspal Singh 

@Mark Roethof 

@Allen Andreas 

@Kalaiarasan Pushpanathan 

@Sandeep Dutta 

@Pradeep Sharma 

 

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn

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.

 

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

LinkedIn

SivaJeneeswari
Tera Expert

You can achieve this using Client Script