zerion

Scroll
Follow

How do I populate an Email Widget using Multi-Select Choices?


To dynamically populate an email widget from multi-select choices, please follow the instructions below.


STEP 1: Add a Multi-Select widget to your form and use my_multi as the data column name.

STEP 2:  Add an option list to your Multi-Select widget with your options.  In this example we'll use: Option 1, Option 2 and Option 3.

STEP 3: Add a Text Area widget and use text_copy as the data column name.

STEP 4: In the Dynamic Value of the Text Area widget, put ZCDisplayValue_my_multi.

PLEASE NOTE: The ZCDisplayValue function takes the Labels from the Multi-Select option list, and concatenates them into a text string, separated by commas for each option.

iFORM TIP: The Text Area widget should not be visible to user.  To hide the widget on the user's device, simply put false into the Condition Value of the widget.

STEP 5: Add an Email widget and make sure the Send Email box is checked.

STEP 6: In the Dynamic Value of the Email widget, put replaceText(text_copy).

STEP 7: From the Form Properties page, place the below function into the Page Level JavaScript.

function replaceText(myText){
myText = myText.replace("Option 1","email1@domain.com, email2@domain.com");
myText = myText.replace("Option 2","email3@domain.com, email4@domain.com");
myText = myText.replace("Option 3","email5@domain.com, email6@domain.com");
return myText;
}

PLEASE NOTE: The Page Level JavaScript function takes the myText variable and replaces the Option 1, Option 2, or Option 3 with the specified email addresses and returns the text string of email(s).

STEP 8: Test out the functionality on your device.

 

    Was this article helpful?
    1 out of 1 found this helpful
    Have more questions? Submit a request

Comments

  • Avatar
    Will Anderson

    What about for a PICK LIST choice? We've tested this solution to populate an email widget from a PICK LIST choice, and it appears to work. Would you recommend against this (if so, why)? Or should it be OK?

Powered by Zendesk