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.

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:
Before you start, make sure you have:
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:
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.
Go to forms.microsoft.com and create a new form. For this lesson, name it "Webinar Follow-Up Survey" and add these questions:
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."
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.
Click the + New step button below your trigger. Search for "Microsoft Forms" again and select "Get response details."
In this action:
Response Id from the trigger step — click inside the field, then click Add dynamic content, and you'll see Response Id listed under the triggerNow 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.
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:
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.
contactid,fullname,emailaddress1,accountid — listing only the columns you need keeps the response payload small and your flow fasterTip
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.
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.
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.
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(split(outputs('Get_response_details')?['body/rd16b'], ' '))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.
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:
Thanks for attending the webinar, [Full Name]! — insert the Full Name dynamic value after the commaHi [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.
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.
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:
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.
"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.
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:
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.
Flow Automation Basics