Outlook.com Email to Dataverse Contact Logger
When an email arrives from a new sender in Outlook.com, auto-create a contact record in Dataverse with their name and email.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow watches an Outlook.com mailbox and, whenever a message arrives from a sender that does not already have a Contact record in Dataverse, automatically creates a new Contact using the sender's display name and email address. The result is a low-friction way to capture inbound leads or correspondents into your CRM without manual data entry — every new person who emails you becomes a tracked Contact the moment their first message lands. The flow uses a Dataverse lookup to avoid duplicate Contacts and parses the friendly-name portion of the From header into first/last name fields when possible.
Use Case
Sales and customer-facing teams frequently receive inbound email from prospects, partners, and other contacts who are not yet in their CRM. Adding each new sender to Dataverse by hand is tedious and easy to forget, which means the CRM never reflects the real shape of the team's network. This flow closes that gap by quietly logging every new sender as a Contact the first time they email in, so reps can immediately see context, activity history, and segment those contacts for follow-up. It is especially useful for small sales teams running on shared mailboxes, founders who use a single Outlook.com inbox for both personal and business correspondence, and anyone piloting Dataverse-based CRM scenarios who wants a steady stream of real contacts to work against.
The flow is ideal for teams that:
- Sales teams using Dataverse / Dynamics 365 as their CRM
- Small businesses operating from an Outlook.com mailbox
- Teams that want every inbound sender automatically captured as a Contact
- Pilots and demos of Dataverse Contact workflows that need real data
Flow Architecture
Trigger: New email arrives (Outlook.com)
When a new email arrives (V2)Fires on every new message in the configured Outlook.com folder (typically Inbox). Provides the sender address, sender display name, subject, and body to the rest of the flow.
Extract sender email and display name
Compose / variablesReads the From address and From name from the trigger output. Lower-cases the email for consistent lookup and splits the display name into first and last name on the first space when possible.
Look up existing Contact in Dataverse
List rows (Dataverse)Queries the Contacts table filtered by emailaddress1 equal to the sender email, with Top Count = 1. Used to decide whether the sender is already known.
If Contact does not already exist
If conditionBranches on whether the Dataverse lookup returned any rows.
- Add a new row (Dataverse) — Contacts — Creates a Contact with firstname, lastname, and emailaddress1 populated from the parsed sender data. Source = 'Email' or similar tag so newly auto-created Contacts are easy to spot.
Empty branch — no action. The existing Contact is left untouched.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_DataverseContactsTable | String | contacts | Logical name of the Dataverse table that stores Contact rows. Leave as 'contacts' unless you have customized the schema. |
| flowlibs_OutlookFolderId | String | Inbox | Mailbox folder the flow monitors for new messages. Typically 'Inbox'; set to a sub-folder id if you only want to log Contacts from a filtered stream. |
| flowlibs_DefaultContactSource | String | Email Auto-Capture | Value written to the Contact 'Source' (or a custom tag) field so auto-created Contacts can be distinguished from manually entered ones. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Outlook.com | shared_outlook | OnNewEmailV2 (trigger) |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords (lookup existing Contact) CreateRecord (create new Contact) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Set the Contact source tag
- Update flowlibs_DefaultContactSource to whatever value your CRM uses to mark auto-captured leads (e.g. 'Inbound Email', 'Auto-Capture') so reporting can filter on it.
- Restrict to a specific folder
- If you only want senders from a filtered or rules-routed folder to be captured, set flowlibs_OutlookFolderId to that folder's id rather than the default Inbox.
- Add domain-based filtering
- Insert a Condition between the trigger and the Dataverse lookup that skips messages from internal or noreply domains so the Contacts table is not polluted with system senders.
- Populate additional Contact fields
- Extend the 'Add a new row' action with values for company, jobtitle, or custom fields — extracted from the email signature with HtmlToText / regex if you want richer profiles.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Lower-case sender email for lookup
Used as the filter value when looking up an existing Contact by emailaddress1, so 'Foo@Bar.com' and 'foo@bar.com' match the same row.
EXPR.02First name from display name
Takes the first whitespace-separated token of the sender display name as the firstname value.
EXPR.03Last name from display name
Takes the last whitespace-separated token as the lastname value; empty if the sender only provided a single name.
EXPR.04Contact-exists check
Drives the If condition — true means a Contact with this email already exists in Dataverse, so the create branch is skipped.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.