Yes/No Variable to display message

Winnie P
Mega Sage

Hello Team - Is there a way to add a message after the 'Yes/No' variable, is answered, ie:find_real_file.png

After a User selects Yes, can you add a message pop up ie: "Please attach your quiz results to this Request"

Thank you.

 

1 ACCEPTED SOLUTION

Hi,

  • Create a YES/No type variable[completed_quiz] I have made with this backend name
  • Create a UI policy find images:Condition: completed_quiz | is | Yes
  • click on dvanced & Set UI script type set to all  
  • add script as shown in the image
  • Execute if true:

function onCondition() {
g_form.showFieldMsg("completed_quiz","Please attach your quiz results to this Request");
}

execute if false:

function onCondition() {
g_form.hideFieldMsg("completed_quiz",true);//backend name of the field should be changed
}

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

View solution in original post

10 REPLIES 10

Hi,

  • Create a YES/No type variable[completed_quiz] I have made with this backend name
  • Create a UI policy find images:Condition: completed_quiz | is | Yes
  • click on dvanced & Set UI script type set to all  
  • add script as shown in the image
  • Execute if true:

function onCondition() {
g_form.showFieldMsg("completed_quiz","Please attach your quiz results to this Request");
}

execute if false:

function onCondition() {
g_form.hideFieldMsg("completed_quiz",true);//backend name of the field should be changed
}

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

Thank you. This worked. Cheers.

Glad it helps!

Harshal Gawali
Giga Guru

Hello Winnie,

@Sagar Pagar mentioned is correct. i.e. You can use showFieldMsg() method. You need to write UI policy and give condition as "Have you completed the quiz is yes". make sure that reverse if false checkbox as true so that it also execute when answer is no.

click on run script section and write g_form.showFieldMsg() method.

For reference check below screenshot.

find_real_file.png

 

Regards,

Harshal.

DirkRedeker
Mega Sage

Hi

I recommend to create a UI Policy for this.

This way you can add your desired condition to the UI Policy and then show the file upload field "quiz results" and make it mandatory.

Then, you do not need any messages at all, because the field suggests the content, and the user cannot submit without the file being uploaded.

Let me know if that answered your question and mark my answer as correct and helpful.

Enjoy & BR

Dirk