cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IanS
Frequent Visitor

Filter Questions/Responses then Email

Hi Flow Community,

 

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?  

 

Thanks in advance,

1 REPLY 1
LeeHarris
Solution Sage
Solution Sage

Hi @IanS 

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.
 
chrome_2019-07-01_17-23-36.png
 
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.
 
chrome_2019-07-01_17-25-07.png
 

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,115)