Wicked Smart Data
LearnInsightsAboutContact
Sign InLet's Build
LearnInsightsAboutContact
Sign InLet's Build
Wicked Smart Data

Intelligence, automation, and expert execution — plus an elite library of free knowledge. We turn complexity into competitive advantage.

Start a conversation

Platform

  • Learning Paths
  • Insights
  • RSS Feed

Company

  • About
  • Contact
  • Work With Us

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Wicked Smart Data. All rights reserved.

Intelligence · Automation · Advantage

All Insights
Power Automate

Automating Contact and Lead Updates in Dynamics 365 with Power Automate: Triggering from Microsoft Forms, Applying Conditions, and Sending Confirmation Emails

Learn how to build a Power Automate flow that captures Microsoft Forms submissions, checks Dynamics 365 for existing Contacts, creates or updates CRM records based on a condition, and sends personalized confirmation emails — all without manual data entry. This step-by-step lesson teaches the upsert pattern every CRM automation needs.

🌱 Foundation17 min readDec 2, 2026Updated Dec 2, 2026
Automating Contact and Lead Updates in Dynamics 365 with Power Automate: Triggering from Microsoft Forms, Applying Conditions, and Sending Confirmation Emails
On this page
  • Introduction
  • Prerequisites
  • Understanding the Architecture Before You Build
  • Step 1: Build Your Microsoft Forms Survey
  • Step 2: Create the Flow and Set Up the Trigger
  • Step 3: Get the Response Details
  • Step 4: Query Dynamics 365 for an Existing Contact
  • Step 5: Add a Condition to Branch the Flow
  • Step 6: Branch A — Update the Existing Contact
  • Step 7: Branch B — Create a New Lead
  • Step 8: Send a Confirmation Email
  • Step 9: Save and Test the Flow
  • Hands-On Exercise
  • Common Mistakes & Troubleshooting
  • Summary & Next Steps

Automating Contact and Lead Updates in Dynamics 365 with Power Automate: Triggering from Microsoft Forms, Applying Conditions, and Sending Confirmation Emails

Introduction

Imagine your sales team runs a weekly webinar. Attendees fill out a registration form before the event, and after the session ends, participants submit a follow-up survey with their contact details, company information, and what they're most interested in buying. Those form responses need to end up in Dynamics 365 — either creating a new Lead record for prospects who've never been in your system, or updating an existing Contact record for people who are already customers. Right now, someone on your team is probably copying and pasting that information by hand.

This kind of manual data entry is exactly where Power Automate shines. By connecting Microsoft Forms to Dynamics 365 through an automated cloud flow, you can capture form submissions the moment they arrive, apply logic to route them correctly, update or create the right records, and send a confirmation email to the person who submitted the form — all without anyone touching a keyboard. By the end of this lesson, you'll have built exactly that flow, and you'll understand every decision along the way.

What you'll learn:

  • How to trigger a Power Automate flow from a Microsoft Forms submission
  • How to retrieve the actual response details from a form
  • How to query Dynamics 365 to check whether a matching Contact already exists
  • How to apply conditional logic to route between updating a Contact and creating a Lead
  • How to send a personalized confirmation email based on the path the flow took

Prerequisites

Before you start, make sure you have:

  • A Microsoft 365 account with access to Power Automate (make.powerautomate.com) and Microsoft Forms (forms.microsoft.com)
  • A Dynamics 365 environment — the Sales or Customer Service app works fine — with permission to create and update Contact and Lead records
  • Familiarity with the Power Automate designer interface. If you've never opened a flow before, work through Getting Started with the Power Automate Interface first
  • A basic understanding of what triggers are. If the concept is new to you, Power Automate Triggers: When to Start a Flow is a quick read that will make this lesson much clearer

Understanding the Architecture Before You Build

Before writing a single action, it's worth sketching the logic in plain English. This prevents you from getting halfway through a flow and realizing your structure doesn't support the branching you need.

Here's what our flow needs to do:

  1. Trigger: A new Microsoft Forms response is submitted
  2. Get details: Retrieve the full response content (name, email, company, interest)
  3. Search: Query Dynamics 365 for a Contact with a matching email address
  4. Branch A — Contact found: Update the existing Contact record with new information
  5. Branch B — Contact not found: Create a new Lead record
  6. Notify: Send a confirmation email to the submitter in both cases, with a slightly different message depending on which path ran

This is a classic "upsert" pattern — short for update-or-insert. It's one of the most common patterns in CRM automation, and understanding it here will serve you in dozens of other scenarios.

Key insight

Dynamics 365 stores Contacts and Leads as separate entity types. Contacts are people with an established relationship to your business; Leads are unqualified prospects. This distinction matters for which table you query and which action you use. If your organization uses them differently, adjust accordingly — the flow logic stays the same.


Step 1: Build Your Microsoft Forms Survey

Go to forms.microsoft.com and create a new form. For this lesson, name it "Webinar Follow-Up Survey" and add these questions:

  • Full Name (Text, required)
  • Email Address (Text, required) — add a note that this should be a business email
  • Company Name (Text, required)
  • What are you most interested in? (Choice: "Product Demo," "Pricing Information," "Partnership Opportunity," "Just Exploring")
  • Are you an existing customer? (Choice: "Yes," "No") — this is a helpful hint, but we'll verify against Dynamics 365 rather than trusting this answer

Keep the form published so it accepts responses. Copy the form's URL from the Share button — you'll need it for testing later.

Tip

When naming form questions, use clear, descriptive labels. Power Automate will display these labels when you're building your flow, so "Email Address" is much easier to work with than "Question 2."


Step 2: Create the Flow and Set Up the Trigger

Navigate to make.powerautomate.com. In the left sidebar, click My flows, then click New flow → Automated cloud flow. Give the flow a descriptive name like Webinar - Create or Update CRM Record. When asked to choose a trigger, search for "Microsoft Forms" and select "When a new response is submitted."

Click Create to open the designer.

In the trigger action, click the Form Id dropdown and select your "Webinar Follow-Up Survey." If you don't see it in the list, you may need to sign in to the Microsoft Forms connector first — click the three dots on the trigger card, select Add a connection, and authenticate with your Microsoft 365 account.

Note

The trigger fires as soon as a response is submitted, but it only gives you the response ID, not the actual content. This is a consistent quirk of the Microsoft Forms connector that catches a lot of beginners off guard. You always need a second step to fetch the content.


Step 3: Get the Response Details

Click the + New step button below your trigger. Search for "Microsoft Forms" again and select "Get response details."

In this action:

  • Set Form Id to the same form you chose in the trigger (click the dropdown and select it again)
  • Set Response Id to the dynamic value Response Id from the trigger step — click inside the field, then click Add dynamic content, and you'll see Response Id listed under the trigger

Now every subsequent step in the flow will have access to the form field values as dynamic content: the submitter's name, email, company, and so on.

If you want to deepen your understanding of how Microsoft Forms integrates with Power Automate more broadly — including handling multi-page forms and conditional branching inside the form itself — Automating Microsoft Forms Responses: Collecting, Routing, and Storing Survey Data with Power Automate covers those scenarios in detail.


Step 4: Query Dynamics 365 for an Existing Contact

This is where the flow starts doing real CRM work. We need to search the Contacts table in Dynamics 365 to see if someone with the submitted email address already exists.

Click + New step and search for "Dataverse" (Dynamics 365 uses Microsoft Dataverse as its underlying data platform). Select the action "List rows."

Configure it as follows:

  • Table name: Contacts
  • Filter rows: emailaddress1 eq ' then insert the dynamic value Email Address from the form response, then close with '

The filter uses OData query syntax, which is the standard query language for Dataverse. The full filter expression looks like this:

emailaddress1 eq 'someone@example.com'

When you're building it in the designer, you'll click inside the Filter rows field, type emailaddress1 eq ', then use Add dynamic content to insert the Email Address value from the form, and type a closing ' after it.

  • Select columns: contactid,fullname,emailaddress1,accountid — listing only the columns you need keeps the response payload small and your flow faster

Tip

The column name emailaddress1 is Dynamics 365's internal schema name, not the display label "Email." If you're unsure of a field's schema name, open your Dynamics 365 app, navigate to Settings → Customizations → Customize the System → Entities → Contact → Fields, and look up the field. Alternatively, use the Integrating Power Automate with Microsoft Dataverse lesson for a full guide to navigating Dataverse schema.

The List rows action returns a collection called value — an array of Contact records that matched your filter. If the array has one or more items, the contact exists. If the array is empty, they don't.


Step 5: Add a Condition to Branch the Flow

Now we apply the conditional logic. Click + New step and select Condition (you'll find it under Control).

We want to check: did the List rows step return any results?

The cleanest way to do this is with an expression. In the left side of the condition, click Add dynamic content → switch to the Expression tab, and enter:

length(body('List_rows')?['value'])

Set the comparison operator to is greater than, and type 0 in the right field.

What this expression does: body('List_rows') retrieves the output of the List rows action, ?['value'] extracts the array of matching records, and length() counts how many items are in that array. If the count is greater than zero, a matching contact was found.

Warning

The action name in the expression must match exactly what Power Automate generated when you added the step. If you renamed the step or if the auto-generated name uses underscores versus spaces, check the actual step name by clicking the three dots on the List rows card and selecting Rename to confirm. A mismatch here will cause the flow to fail at runtime.

Understanding conditions and how to structure them well is covered thoroughly in Working with Conditions, Loops, and Variables in Power Automate — worth reading if you want to handle more complex branching patterns.


Step 6: Branch A — Update the Existing Contact

Inside the If yes branch of the condition, we'll update the existing Contact record.

Click Add an action in the Yes branch. Search for Dataverse and select "Update a row."

Configure it:

  • Table name: Contacts

  • Row ID: We need the Contact ID from the first record in our list. Click Add dynamic content → Expression and enter:

    first(body('List_rows')?['value'])?['contactid']
    

    This takes the first() item from the returned array and extracts its contactid field.

  • Company Name (the parentcustomerid or a simple text field, depending on your setup): map to the Company Name dynamic value from the form

  • Description or a custom field for "Interest Area": map to the What are you most interested in? form value

  • Modified on will update automatically — no action needed

Key insight

You're only updating fields where you have new information from the form. It's good practice not to overwrite fields you don't have data for. If your form doesn't collect a phone number, don't touch the phone number field in Dynamics 365 — leave it as-is so you don't accidentally blank out data your sales team entered manually.


Step 7: Branch B — Create a New Lead

Inside the If no branch, we create a new Lead record. Click Add an action in the No branch. Search for Dataverse and select "Add a new row."

Configure it:

  • Table name: Leads

  • Topic: Use an expression to generate a meaningful topic:

    concat('Webinar Lead - ', outputs('Get_response_details')?['body/r1f7b2e44fc3a4ba0b30dfb7d37c68001'])
    

    Actually, in the designer it's simpler — just type Webinar Lead - and then insert the Full Name dynamic value. The result looks like: Webinar Lead - Jordan Smith

  • First Name / Last Name: Dynamics 365 splits names into separate fields. Use an expression to handle this:

    • First Name: first(split(outputs('Get_response_details')?['body/rd16b'], ' '))
    • Last Name: last(split(outputs('Get_response_details')?['body/rd16b'], ' '))

    In practice, you can click directly on the First Name field and use dynamic content to reference the form's Full Name value directly — Dataverse will accept it in the Full Name field as a combined string too, depending on your configuration

  • Email Address: Map to the Email Address form value

  • Company Name: Map to the Company Name form value

  • Description: Map to the interest area response

  • Lead Source: Set to a fixed value like Web — this is useful for reporting

Tip

If your Dynamics 365 instance has required fields on the Lead entity beyond what the form collects — like a phone number or rating — you'll need to supply placeholder values or use a Compose action to default them. Missing required fields will cause the "Add a new row" action to fail with a 400 error.


Step 8: Send a Confirmation Email

After the condition block (outside both branches, so it runs regardless of which path was taken), we'll send a confirmation email to the person who submitted the form.

Click the + button below the entire condition block — not inside either branch — and add a new step. Search for "Office 365 Outlook" and select "Send an email (V2)."

Configure it:

  • To: The Email Address dynamic value from the form response
  • Subject: Thanks for attending the webinar, [Full Name]! — insert the Full Name dynamic value after the comma
  • Body: Write a friendly message. For example:

Hi [Full Name],

Thank you for joining us at today's webinar and for taking the time to share your details. Our team will follow up with you about [What are you most interested in?] within the next two business days.

We look forward to connecting!

The Sales Team

Insert the actual dynamic content values where the brackets appear above.

If you want the email body to vary slightly depending on whether a Lead or Contact was updated, you can add two separate Send an email actions — one inside each branch — with slightly different copy. For example, the Contact branch might say "Great to hear from you again!" while the Lead branch says "Welcome — we're excited to connect!" This level of personalization makes your automation feel far more human.

For a deeper dive into email automation patterns in Power Automate, including HTML formatting and attachments, see Automate Email Notifications with Power Automate.


Step 9: Save and Test the Flow

Click Save in the top right of the designer. Once saved, it's time to test.

Click Test → Manually → Test. Now open your Microsoft Forms survey in a new browser tab and submit a test response. Use an email address that you know exists as a Contact in Dynamics 365, so you can verify the update path.

Go back to Power Automate. The test run will show you each action as it executes, with green checkmarks for success and red Xs for failures. Click on any action to expand it and see the exact inputs and outputs — this is how you confirm that your condition evaluated correctly and that the right branch ran.

Then run the test again with an email address that doesn't exist in Dynamics 365, to verify the Lead creation path.

Warning

Microsoft Forms has a brief delay between when a response is submitted and when the trigger fires — usually a few seconds to a few minutes in production. During testing in a free or trial environment, this delay can sometimes stretch to 10 minutes. If your flow doesn't trigger immediately, wait a few minutes before assuming something is broken. Check the flow's Run history to see if the trigger fired.


Hands-On Exercise

Now that you understand the full flow, build a variation that handles a slightly different business scenario:

Scenario: Your company runs a trade show. Booth visitors scan a QR code to fill out a Microsoft Forms contact card. The form collects: First Name, Last Name, Email, Company, and "Estimated Budget" (a choice field: "Under $5,000," "$5,000–$25,000," "Over $25,000").

Your task:

  1. Build the form in Microsoft Forms
  2. Create a flow that queries Dynamics 365 Contacts by email
  3. Add a condition: if the contact exists, update their record; if not, create a Lead
  4. Add a second condition inside the Lead creation branch: if the Estimated Budget choice is "Over $25,000," set the Lead's Rating field to "Hot"; otherwise set it to "Warm"
  5. Send a confirmation email in all cases

This second condition inside a branch is called a nested condition, and it's a critical pattern for real CRM workflows where routing depends on multiple criteria. Once you've built this, you'll have a genuinely reusable template for trade show automation.


Common Mistakes & Troubleshooting

"List rows returns empty even though the contact exists" Double-check your OData filter syntax. The most common culprit is a missing space around eq or mismatched single quotes. Also verify that you're filtering on the right field — emailaddress1 is the primary email in Dynamics 365, but some organizations use emailaddress2 or a custom field.

"The condition always takes the same branch" Check the expression inside your condition. If you're seeing it always go to "No," expand the condition action in your run history and look at the actual value being evaluated. A common mistake is wrapping the expression incorrectly or referencing the wrong action name.

"Update a row fails with a 404 Not Found" Your first() expression to extract the Contact ID worked, but the ID came back empty or malformed. Expand the List rows step in run history and verify the structure of the value array — make sure contactid is included in your Select columns list.

"Add a new row fails with a 400 Bad Request" You're missing a required field on the Lead entity. Open the error details in the run history to see which field is flagged, then either add it to your form or hard-code a default value in the flow.

"The confirmation email isn't arriving" Check your Outlook connector authentication — if your connection expired or was set up under a different account, the action will fail silently if error handling isn't configured. Also verify the email address dynamic content is resolving to a valid address by checking the action's input in run history.

For a systematic approach to diagnosing flow failures, Using Power Automate Run History and Flow Checker to Debug and Fix Failing Flows walks through every tool available to you.


Summary & Next Steps

You've just built a production-ready CRM automation that connects three Microsoft services — Forms, Power Automate, and Dynamics 365 — into a coherent, logical workflow. The pattern you learned here — trigger, fetch details, query for existing records, branch on the result, write to the database, notify the user — is a template you'll reuse constantly across different business scenarios.

Here's what you accomplished:

  • Configured a Microsoft Forms trigger and retrieved full response details
  • Queried Dynamics 365 Contacts using an OData filter expression
  • Applied a condition based on the length of the returned record array
  • Updated an existing Contact in one branch and created a new Lead in the other
  • Sent personalized confirmation emails from both branches

Where to go from here:

If you want to handle more complex data manipulation — like parsing a multi-select choice field into separate tags, or transforming the budget range text into a numeric score — Transforming and Mapping Data with Power Automate's Compose, Select, and Filter Array Actions is the natural next lesson.

If your organization needs a human to review and approve new Leads before they're created in Dynamics 365 — especially for high-value prospects — Building Approval Workflows with Power Automate will show you how to insert an approval step between the condition and the record creation.

And if you're ready to extend this flow further — routing the new Lead to a sales rep in Teams, creating a Planner task for follow-up, and copying the form data to a SharePoint list as a backup — that multi-connector pattern is exactly what Chaining Microsoft 365 Connectors in a Single Flow covers.

Work With Us

From insight to implementation

Reading is the start. When you're ready to build the data, automation, or AI systems behind it, our team turns strategy into shipped results.

Let's Build

Flow Automation Basics

Previous

Automating Multi-File Email Attachment Processing with Power Automate: Filtering by Type, Saving to SharePoint Folders, and Triggering Approval Flows Based on Document Content

Related Insights

Power AutomateExpert

Implementing Power Automate Work Queue SLA Policies and Priority-Based Dispatch: Configuring Deadlines, Escalation Thresholds, and Queue Routing Rules for Time-Critical Enterprise Processing Pipelines

29 min
Power AutomateExpert

Implementing Desktop Flow Orchestration with Work Queues in Power Automate: Distributing RPA Jobs Across Machine Groups, Tracking Item State, and Handling Exceptions for Scalable Unattended Processing

30 min
Power AutomateExpert

Automating Multi-File Email Attachment Processing with Power Automate: Filtering by Type, Saving to SharePoint Folders, and Triggering Approval Flows Based on Document Content

27 min

On this page

  • Introduction
  • Prerequisites
  • Understanding the Architecture Before You Build
  • Step 1: Build Your Microsoft Forms Survey
  • Step 2: Create the Flow and Set Up the Trigger
  • Step 3: Get the Response Details
  • Step 4: Query Dynamics 365 for an Existing Contact
  • Step 5: Add a Condition to Branch the Flow
  • Step 6: Branch A — Update the Existing Contact
  • Step 7: Branch B — Create a New Lead
  • Step 8: Send a Confirmation Email
  • Step 9: Save and Test the Flow
  • Hands-On Exercise
  • Common Mistakes & Troubleshooting
  • Summary & Next Steps