Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 81okafWcgXAD1x7F3hq4Pc
Power Automate - Building Flows
Answered

send 2 different emails based on form response

Like (0) ShareShare
ReportReport
Posted on 21 Jun 2024 23:33:13 by 8

My microsoft form has a multiple choice question to select the department. 

I have 2 departments: IDENTITY and  ANALYTICAL. 

I would like to send a customized email to the department selected. I chose Switch instead of Condition in the event that I want to add another department. 

 

My flow is currently failing due to the Switch part.

Error message is: 

Action 'Switch' failed: The execution of template action 'Switch' failed: The result of the evaluation of 'scope' action expression '@body('Get_response_details')?['rb7c58ace1ba541d8a66f63218c468793']' is not valid. It is of type 'Null' but is expected to be a value of type 'String, Integer'.

 

How do I get this flow to recognize the switch? 

Attached is the screenshot of my flow. 

  • dyusaurr Profile Picture
    8 on 27 Jun 2024 at 00:11:28
    Re: send 2 different emails based on form response

    fixed! branching in forms broke my output. Removed branching and the above solution worked! 

  • dyusaurr Profile Picture
    8 on 24 Jun 2024 at 23:30:19
    Re: send 2 different emails based on form response

    I started my flow over to follow your video and am wondering if this beginning step is the issue. 

    I am not seeing anything in the output. See attached. 

  • dyusaurr Profile Picture
    8 on 24 Jun 2024 at 19:11:30
    Re: send 2 different emails based on form response

    Thank you for your input! I have tried the Compose in the old designer and attached is the issue that comes up: 

     

    How do I fix my switch to recognize my compose? 

  • Verified answer
    creativeopinion Profile Picture
    10,389 Super User 2025 Season 1 on 22 Jun 2024 at 00:38:23
    Re: send 2 different emails based on form response

    @dyusaurr To troubleshoot your Switch action, add a Compose action above your Switch action to output the dynamic content you are using in the Switch action. The error you are getting is indicating that the dynamic content you've inserted into the Switch action is null (aka there isn't a value). 

     

    I would also recommend you toggle off the new designer and use the classic designer as the new designer is still buggy especially when using the MS Forms trigger and action. It can also help to see your flow in the Classic Designer (with all actions expanded).

     

    Instead of duplicating your actions across both switch branches. I'd recommend using expressions to streamline your flow so you can conditionally display content based on the selection made. This way you don't need to duplicate the content. 

     

    You might find this YT Tutorial helpful as it covers functions that you can use in your expressions for your flow: 7 Functions You Need to Know | ️Expression Essentials: Part 1

     

    In this section, I'll cover how to get dynamic content with an expression when the dynamic content you need isn't listed in the dynamic content menu.

     

    In the full tutorial I cover 7 functions you need to know when getting started with expressions.

    1️⃣ empty()

    2️⃣ coalesce()

    3️⃣ equals()

    4️⃣ if()

    5️⃣ concat()

    6️⃣ length()

    7️⃣ split()

     

    I cover how to use these functions in expressions and I’ll also cover common mistakes when it comes to writing expressions and show you a few tips and tricks along the way.

     

    As a beginner or even an intermediate flow builder—expressions can seem a bit complex at first, I’m going to try to simplify it for you. If you want to level up your flows by writing expressions—keep watching!

     

    IN THIS VIDEO:

     What is an Expression?

     What is a Function?

     What Does Wrapping a Function Mean?

     How Do I Insert an Expression?

     How to Use a Compose action

     How to Navigate the Expression Builder with Arrow Keys

     How to use the Expression Tooltip

     Common Mistakes When Writing Expressions

     How to differentiate a null from an empty string

     How to Get Dynamic Content When it’s Not Listed

     How to Use a Get Item Action to Verify Dynamic Content Output

     How to Convert Strings to Lower Case

     How to Troubleshoot the if() Function

     

    -----

     

    You may also find these MS Form Tutorials helpful:

     

    In this Microsoft Power Automate tutorial, I’ll show you how to get your Microsoft Form responses into SharePoint. I’ll cover how to build a Microsoft form with conditional fields by using branching. You’ll learn how to format your multiple choice responses for a SharePoint multi-choice column as well as converting it to text. I’ll also show you how to take a text response and convert it to a number with a switch action and with an expression. After adding the response to SharePoint, we’ll send the user an email confirmation with all the details of their form submission.

     

    IN THIS VIDEO:

     How to get a Microsoft Form Response into SharePoint

     How to get a Microsoft Form ID

     How to get a Microsoft Form response

     How to Build a Microsoft Form with Conditional Fields

     How to used Branching in Microsoft Forms

     How to format Microsoft Form multiple choice responses for a SharePoint multi-choice column

     How to parse a Microsoft Form multiple choice response as string of text

     How to convert a text response to a number

     How to use the Switch action

     How to create a custom email confirmation for a Microsoft Form submission

     How to Create a Custom View in a SharePoint list

     How to use the Compose Action

     How to write Power Automate Expressions

     

    ----

    You might also find this YT Tutorial helpful: How to Get Microsoft Form File Uploads Attached to an Email 📧

     

    In this Microsoft Power Automate Tutorial I’m going to cover where file uploads from your Microsoft Forms are saved. I’ll also show you how attach the uploaded files to an email and how to dynamically name the files and customize the recipient of the email based on the selections made in your Microsoft Form. I will also cover how to handle responses that don’t include any file uploads.

     

    IN THIS VIDEO:

    ‌ Two types of MS Forms

    ‌ Where Microsoft Personal (OneDrive) Form File Uploads are Saved

    ‌ Where Microsoft Group Form File Uploads are Saved

    ‌ How to Add a File Upload Question to an MS Form

    ‌ How to get a Microsoft Form ID

    ‌ How to get a Microsoft Form Response

    ‌ How to Get the Dynamic Content Microsoft Form File Upload Content

    ‌ How to handle Single and Multiple Microsoft Form File Uploads

    ‌ How to use a Scope action to Organize and Group Your Flow Actions

    ‌ How to Get the File Content from an MS Form File Upload

    ‌ How to Collect All Files Uploaded to a MS Form and Attach to an Email

    ‌ How to Handle MS Form Response When a File Isn’t Uploaded

    ‌ How to Create an Email Key

    ‌ How to Send an Email to a Specific Recipient Based on Form Selection

    ‌ How to Create a Dynamic Output Based on Form Selection

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started