I am trying to use Flow to take an MS Forms response and send it in an email. I want the email to list the form question titles and answers, but only for questions that contain answers (exclude null Answers).
I have been trying putting the Forms Responses into an Array Variable and then using Filter Array, but i'm flailing around.
Solved! Go to Solution.
Hi @brock , thank you for your post.
See below for a solution.
Note: This could be tidier using composes to store the form answers but you'll see this works for my example.
Here is the form:
I have answered only 2 questions, Q1 & Q2 and I get these results in an email.
Here is the Flow.
if(equals(not(empty(body('Get_response_details')?['rd0991dbc9ca24915b9b7dfc0b1dbbc05'])), true), concat('Q4: ', body('Get_response_details')?['rd0991dbc9ca24915b9b7dfc0b1dbbc05']), null)
if(equals(not(empty(body('Get_response_details')?['r4b6e28cb8fa748dea068dc564271226e'])), true), concat('Q1: ', body('Get_response_details')?['r4b6e28cb8fa748dea068dc564271226e']), null)
if(equals(not(empty(body('Get_response_details')?['r1db7d847e9ff4072b9f10f7d71382ae2'])), true), concat('Q2: ', body('Get_response_details')?['r1db7d847e9ff4072b9f10f7d71382ae2']), null)
if(equals(not(empty(body('Get_response_details')?['read2ee4db44e4e00a59afdbfb4685940'])), true), concat('Q3: ', body('Get_response_details')?['read2ee4db44e4e00a59afdbfb4685940']), null)
Clearly, you will need to change each form answer to yours
If you look closely at each body('Get_response_details')?['GUID'] you can see what to change.
Even better, add each question to a compose to save the long GUID style value in you If statements.
If you replicate this, it will work based on my successful testing.
If you have found my post helpful, please mark thumbs up.
Any other questions, just ask.
Thanks, Alan
Proud to be a Flownaut!
Hi @brock , thank you for your post.
See below for a solution.
Note: This could be tidier using composes to store the form answers but you'll see this works for my example.
Here is the form:
I have answered only 2 questions, Q1 & Q2 and I get these results in an email.
Here is the Flow.
if(equals(not(empty(body('Get_response_details')?['rd0991dbc9ca24915b9b7dfc0b1dbbc05'])), true), concat('Q4: ', body('Get_response_details')?['rd0991dbc9ca24915b9b7dfc0b1dbbc05']), null)
if(equals(not(empty(body('Get_response_details')?['r4b6e28cb8fa748dea068dc564271226e'])), true), concat('Q1: ', body('Get_response_details')?['r4b6e28cb8fa748dea068dc564271226e']), null)
if(equals(not(empty(body('Get_response_details')?['r1db7d847e9ff4072b9f10f7d71382ae2'])), true), concat('Q2: ', body('Get_response_details')?['r1db7d847e9ff4072b9f10f7d71382ae2']), null)
if(equals(not(empty(body('Get_response_details')?['read2ee4db44e4e00a59afdbfb4685940'])), true), concat('Q3: ', body('Get_response_details')?['read2ee4db44e4e00a59afdbfb4685940']), null)
Clearly, you will need to change each form answer to yours
If you look closely at each body('Get_response_details')?['GUID'] you can see what to change.
Even better, add each question to a compose to save the long GUID style value in you If statements.
If you replicate this, it will work based on my successful testing.
If you have found my post helpful, please mark thumbs up.
Any other questions, just ask.
Thanks, Alan
Proud to be a Flownaut!
this is brilliant and absolutely puts me on my way!
Another question though @AlanPs1 :
How can I pull the Question text with an expression? I see you are pulling the Answer text from the Get Response body with an expression. When I run a Flow test, the OUTPUTS of Get Response details has this info, but I don't know how to get at it.
🙂
I asked my followup question in a seperate question as that might be helpful for people: Pull MS Forms Question
User | Count |
---|---|
87 | |
73 | |
43 | |
26 | |
26 |
User | Count |
---|---|
42 | |
27 | |
25 | |
23 | |
18 |