Macro expression for drop-down list on form

Wei Wang asked on May 12, 2020 18:10

I try to use macro expression as value of the drop-down list for a form field but couldn't get it to work:

{% if (TravelOutside.value=="Yes") {"xxx@xxx.com","xxx@xxx.com"} else {"",""} #%}

I want the drop-down list to have the email when the TravelOutside field value is "Yes", otherwise blank.

Thanks! Wei Wang

Correct Answer

Peter Mogilnitski answered on May 12, 2020 18:53

{% if (TravelOutside == "Yes") {"xxx@xxx.com;xxx@xxx.com"} else {";"} #%}

or

{% (TravelOutside == "Yes")? "xxx@xxx.com": "" %};{%(TravelOutside == "Yes")? "xxx@xxx.com": "" %}

0 votesVote for this answer Unmark Correct answer

Recent Answers


Wei Wang answered on May 12, 2020 19:05

Thanks Peter, but none of them work :(

0 votesVote for this answer Mark as a Correct answer

Wei Wang answered on May 12, 2020 19:35

Thanks Peter, it's working now after I took off the macro brackets.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.