I am trying to find a "cleaner" solution to my current implementation.
I have built a MS Form that has a few different sections and about 50 questions total. Since this form is using branching, not all questions will ever be answered by a single user in a single session. At the completion of the form, the answers are emailed out to me.
The issue is that the email body would have all of the questions, even those without answers. I have managed to address this by using switches (controls), and based on what "branch" they go down, the email only documents and shows the answers for the specific questions in that particular branch. Unfortunately, this means that I could have MANY different "send an email" action and if I change anything I then have to modify each of those actions.
I see that when editing the body of the email, I can reference "if(expression, valueifTrue, valueifFalse)" in the expression functions.
Could I build a single "send an email" action and in the body of the email use expressions to build the message? For instance I could use something like (very simplified):
-----email body------
if "answer1 not equal to null"; then
echo "Question #1"
echo "$answer1"
fi
if "answer2 not equal to null"; then
echo "Question #2"
echo "$answer2"
fi
---- end of email body-------
This way I could only provide the Question and Answer of those that were populated in the email body. Minimizing the number of "Send an email" actions I would need and probably making my coding more efficient overall.
Thanks in advance,
pdxwarrior