I would like to give the user the option to add up to 3 email addresses. I created a behavior that combines all 3 variables into one variable called email addresses before submitting the form. I get errors that the other 2 are blank (because 2 are optional). How can I script it so it checks to see which variables are being used and only sends to that email address so no errors occur on submission?
1) Use a Multiple Branch object with three Notify objects. On the join paths from the Multiple Branch specify your conditions (Email 2 is not empty AND Email 3 is empty – send notification to 1 & 2, not 3, etc…)
2) Use a hidden helper field. When the submit button is clicked set the hidden helper with a formula (email 1;email 2;email 3). Then set the role to which you are sending the notification to the hidden helper field. No spaces between ; and next email.