Yes / No Variable.

Tfnhodgi
Tera Contributor

Two questions.

If I have a Yes / No and Yes is selected within the Catalog item can it auto populate a free text line?

Select yes --> Free text is populated to enter info.

 

Second questions. 

Yes/ No If Yes is selected can a multiple choice populate?

 

ty for any feedback. 

1 ACCEPTED SOLUTION

abirakundu23
Mega Sage

Hi @Tfnhodgi ,

You can achieve .You can use either on change catalog client script or catalog UI policy. 
Just one question same Yes/No variable you want to perform 2 actions for "Yes" selection.

1. If I have a Yes / No and Yes is selected within the Catalog item can it auto populate a free text line?

Select yes --> Free text is populated to enter info.

function onChange(control, oldValue, newValue, isLoading) {
   if (newValue == 'Yes') {
    
      g_form.setValue('test1',"Hello world");
   }
}
2. Yes/ No If Yes is selected can a multiple choice populate?
if (newValue == 'Yes') {
    
      g_form.setValue('choice field',"choice1");
   }
Please mark Helpful & correct answer if resolved your purpose.
   
   
 

 

View solution in original post

2 REPLIES 2

Sarika S Nair1
Kilo Sage

Hi @Tfnhodgi , 

Try to create an onchange catalog client script on Yes/No variable and use below script 

if(newValue=='Yes'){

g_form.setValue('textvariablename','Text to be autopulated');

}else if(newValue =='No'){

g_form.setValue('multiplechoicevariablename','choicevalue');

}

 

abirakundu23
Mega Sage

Hi @Tfnhodgi ,

You can achieve .You can use either on change catalog client script or catalog UI policy. 
Just one question same Yes/No variable you want to perform 2 actions for "Yes" selection.

1. If I have a Yes / No and Yes is selected within the Catalog item can it auto populate a free text line?

Select yes --> Free text is populated to enter info.

function onChange(control, oldValue, newValue, isLoading) {
   if (newValue == 'Yes') {
    
      g_form.setValue('test1',"Hello world");
   }
}
2. Yes/ No If Yes is selected can a multiple choice populate?
if (newValue == 'Yes') {
    
      g_form.setValue('choice field',"choice1");
   }
Please mark Helpful & correct answer if resolved your purpose.