How to autopopulate a choice field the selection of on two other fields

morrix3
Giga Expert

Hey gang
This is the situation.
I have a field; let's call it (field_c). It is a choice field. It needs to auto-populate, based on the selections from two 'reference fields' (field_a) & (field_b).

So for example field_a = Ice Cream & field_b = banana then field_c = Banana Split
                         field_a = vanilla cone & field_b = chocolate then field_c = Dipped vanilla cone.  

I have no idea how to make this happen? Does it need coding or is there a simpler way to make this happen?

Thanks

1 ACCEPTED SOLUTION

Chetan Mahajan
Kilo Sage
Kilo Sage

Hi Morrix,

                     You have to create 2 onChange Client script for both field_a and field_b. write script as below

 

function onChange() {
//Type appropriate comment here, and begin script below
var A= g_form.getValue('field_a');
var B= g_form.getValue('field_b');

if (A== 'Ice Cream'){

if(b== 'banana'){

g_form.setValue('field_c','Banana Split');
}

 

you can do like this, but again its depend on your business requirement, if every time A and B filed value get changed and based on that you need to update c field then you can go for data lookup https://www.youtube.com/watch?v=X6hWzFAodiE 

 

Kindly mark correct and helpful if applicable

View solution in original post

4 REPLIES 4

Chetan Mahajan
Kilo Sage
Kilo Sage

Hi Morrix,

                     You have to create 2 onChange Client script for both field_a and field_b. write script as below

 

function onChange() {
//Type appropriate comment here, and begin script below
var A= g_form.getValue('field_a');
var B= g_form.getValue('field_b');

if (A== 'Ice Cream'){

if(b== 'banana'){

g_form.setValue('field_c','Banana Split');
}

 

you can do like this, but again its depend on your business requirement, if every time A and B filed value get changed and based on that you need to update c field then you can go for data lookup https://www.youtube.com/watch?v=X6hWzFAodiE 

 

Kindly mark correct and helpful if applicable

I am going to go with the recommendation of going with Data Lookup.
I appreciate your help with this.

chrisperry
Giga Sage

Hi there,

If you want to avoid coding you could use Flow Designer instead, something like below should work:

find_real_file.png

 

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

If this answer is helpful please mark correct and helpful!

Regards,

Christopher Perry

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry

Thank you so much, Christopher.  I think that based on the business requirements and the number of different choices.  I am going with the recommendation from Chetan.
I appreciate the time you took to send this response.