Create contact from received Email using Flow

EmailToCRMUsingFlow2 copy

Last week in a meeting client explained requirement:

“.. we receive emails in a mail box, and we manually create contacts in CRM using sender name and address for further processing, we want to automate this.. .”

This task was going to extend existing system functionality but there was no existing code to reuse or modify and of course expectation was to deliver this soon. So it was a perfect case to use Microsoft Business Application Platform. In this post I will explain how easy it was to provide solution using Flow.

New to Flow ?

Flow is part of Business Application Platform and it is latest service from Microsoft to create automated workflow. It is intended for business and power users so most of the time tasks can be performed without writing a single line of code. Some of its cool features are:

  1. It integrates different systems and applications
  2. Create workflow and automation tasks
  3. Transfer data between systems
  4. Can be used easily with a bunch of other Microsoft technologies

To get started first step is to sign up at flow.microsoft.com. Currently there is a basic “Flow Free” plan which is free, for more details about pricing see this.

How Flow Works ?

There are three basic components in Flow which are connector, trigger and action.

Connector is used to connect to source and target system. A few examples of connectors are Dynamics 365, OneDrive, Gmail, Twitter, Excel, Azure Storage, Oracle, DB2, RSS, Eventbrite or Youtube. At the time almost 227 connectors are available and hopefully this number will increase.

A trigger is an event that occurs inside the connector. For example with SharePoint a few triggers are:

  • File creation
  • Deletion of a file
  • File modification

Similarly a trigger with Gmail is when a new email arrives. A connector can have multiple triggers and in a flow usually we chose a trigger which start execution of flow.

After selecting trigger normally next step will be to chose target system or service (again using connector). Similar to triggers with source connector, a target connector may have multiple associated actions to chose from. For example Office 365 Outlook has:

  • Create Contact
  • Send Email
  • Create Event

By choosing an action we tell what should happen to target system or server. Good thing is we can chose multiple actions which will be performed one by one. For example we can create a flow which on receiving an email will send a sms, create a file in Sharepoint and also create record in Dynamics 365.

Solution

  • Sign in to https://flow.microsoft.com/ and click “See all ” link
  • Search and select Gmail
  • Click “When a new email arrives”

ETOC1

ETOC2

CCFEF3

  • Click menu and sign in using your Gmail account using “+ Add new connection”

CCFEF4

  • Click “add an action”
  • Type Dynamics and then click “Dynamics 365 – Create a new record”

CCFEF5

  • Click menu and then from “+ Add new connection” sign in to Dynamics 365 account
  • Select your Dynamics 365 organization name in “Organization Name” field
  • Select ‘Contact’ as entity from “Entity Name” field
  • After selecting entity name more fields will be loaded in “Create a new record” form

CCFEF7

CCFEF8

CCFEF8.1.PNG

  • In form click “Last Name” and then from dynamic content list select “Sender’s Name”
  • Similarly select “Email” in create a new record form and then from dynamic content “From” email address
  • Press Save button to save the Flow and that is all !

CCFEF9

CCFEF10

CCFEF11

  • Send email to linked account and after 3-4 second verify new contact created in Dynamics 365 from email received.
  • Click “My flows” link and then click flow listed to verify its execution was successful

CCFEF12

CCFEF13

Note:

This demo was created using Gmail, but for Outlook, “Outlook.com” and “Office 365 Outlook” two connectors are available. One catch though is at the time they do not offer senders name as dynamic content. A solution can be to redirect Outlook emails to a Gmail box and configure Gmail to create a contact in Dynamics 365.

Author: Yawer Iqbal

Share This Post On
Share via
Copy link
Powered by Social Snap