I have a Form set up that goes through a series of questions, getting responses that are either "Yes", or an input from whoever is filling it out. This currently links to a Flow that takes all the responses and sends out an email that follows this format:
Has the xyz been done? [Response: Has the xyz been done]
So the email is a combination of text outlining the question, then whatever the response was from whoever submitted the form.
What I'd like to do is filter out all of the "Yes" responses, and only send emails when a response has been typed in by the submitter.
I can't work out how to do this though, each Form has 20-30 questions, and it seems like a terrible idea to use 20-30 conditional statements in a row. The second part of the problem is that I will need to include the relevant question which, at the moment, is typed into the Send an Email block body. Any ideas?
You could use a single Condition action to check that at least one of the responses is not Yes and therefore an email needs to be sent.
Then, either direct in the email body or in a Compose action (which you can use the Output of in the body), you can create an expression similar to the below for each question (where triggerBody()['questioninput'] is the question response)
if(equals(triggerBody()['questioninput'],'Yes'),'',concat('<br>For this question you said: ',triggerBody()['questioninput']))
This will only display the text and response if the value of the response is not equal to 'Yes'. You should end up with multiple expressions in your Compose action.
If you then make sure that your email is marked as being HTML then the line break tags that are used in the expressions will function as expected.
Did I answer your question? Mark my post as a solution!