Skip to the main content.

3 min read

Creating Leads in Dynamics 365 Using Microsoft Flow

Creating Leads in Dynamics 365 Using Microsoft Flow
Creating Leads in Dynamics 365 Using Microsoft Flow
4:44

Tutorial: Creating Leads using Microsoft Flow

Microsoft Flow is a tool that can create automated processes across many applications such as Twitter, SharePoint, Outlook and Dynamics 365. It can help automate processes in ways not possible before in previous versions of CRM. All of this can be done without the use of a developer, which saves time and money. This article will focus on the steps to configure MS Flow to automate Lead creation in CRM from an external website. Previously, if you wanted a visitor filling out contact information on your website to automatically be created as a Lead in Dynamics, you would have to spend a lot of time on custom development. With Microsoft Flow, the process is much simpler and streamlined.

 

Navigate to Microsoft Flow

Go to https://portal.office.com and login with your organization credentials. Once in, click on the “Flow” tile.

Create a New Flow

In the Flow website, click on “My flows”. Then, click on “Create from blank”:

Navigate to Microsoft Flow

Choose a Trigger Action

Click in the search box that says “Search hundreds of connectors and triggers”. This will take you to a new page. Then type “http” in the search box. Click on “Request – When a HTTP request is received” trigger that comes up in the results:

Choose a Trigger Action

Insert JSON Schema

You have now selected an HTTP trigger. This trigger will fire from the webpage you connect to Flow. You must insert a JSON schema into the trigger. The schema should contain the names of the fields on your webpage that you want to be pushed into Dynamics. Here is an example of what a JSON schema looks like:

Once this has been inserted into the Request Body, click the New Step button:

trellispoint

Add Create Lead Action

After you click the New Step button, you have the option to Add an action or Add a condition. Choose Add an action. In the search box that appears, type “dynamics”. Click “Dynamics 365 – Create a new record” in the results that appear:

e:

Once this has been inserted into the Request Body, click the New Step button:

Add Create Lead Action

Configure Record Creation

In the Create a new record action that appears, choose the proper Organization Name from the drop-down. Then choose the correct entity type of the record you wish to create. In this example, we will be creating a Lead record. Once these options are selected, the box will expand to show you all available fields to set for creation:

Configure Record Creation

Fill in Required Fields

Fill in the required fields for the Lead. The field information brought over from the HTTP request should be available as Dynamic Content to insert into the fields. Any field identified in your JSON schema should be available as dynamic content:

Fill in Required Fields

Save Flow and Generate HTTP POST URL

Once you have filled in all the fields desired in the Lead creation step, save the Flow using the save button in the upper right-hand corner of the screen.

Copy HTTP POST URL

Take note that once the Flow is saved, the HTTP POST URL has been automatically generated. This is extremely important as this URL connects your website to Flow:

Copy HTTP POST URL

Add POST URL to Your Website

On your website, put the auto-generated URL into a new XMLHttpRequest. An example of the function, plus a very simple and testable web form is below. This will show you how this can be done and where the URL could be put in:

Run Code in Chrome to Test

If you have Notepad++, you can save and run the code from above in a browser. Be sure that you have pasted in your unique POST URL and then saved the code from above. The webpage that opens should look like this:

Run Code in Chrome to Test

Fill in Fields and Click Submit Button

Fill in the fields and click the Submit button. Then, navigate back to Flow to see if the job ran:

Fill in Fields and Click Submit Button

Verify if Test Was Successful

Go back to Microsoft Flow and verify that the test ran successfully. If you go back to “My Flows”, you should see a Run History:

Verify if Test Was Successful

Navigate to Dynamics and Verify that Lead Was Created

Now if we navigate to our Dynamics 365 environment, we can see that the Lead was created successfully. All the fields that we wanted to be populated will have been filled in as we desired.

Conclusion

Integrating webforms with Dynamics is significantly simplified with Microsoft Flow. The utility of Flow doesn’t stop here, either. You can set up email alerts when a new Lead is created. Or you can assign these new Leads to a user other than yourself. In the past, this process took custom development and was costly. But now, all you need is a little knowledge of JavaScript and you can easily set up webform CRM integration in a simple and cost-effective way.

Navigate to Dynamics and Verify that Lead Was Created

Learn more about Microsoft D365

 

Book a Demo   Learn More

 

SalesLogix Migration: What you Need to Know.

SalesLogix Migration: What you Need to Know.

Saleslogix – 4 reasons to migrate Infor CRM (Saleslogix) to Microsoft Dynamics 365 Are you considering migrating your outdated Infor CRM System...

Read More
Enrich your CRM Data with Excel

Enrich your CRM Data with Excel

Update Dynamics 365 for Sales data with Microsoft Excel Using Microsoft Dynamics 365 (CRM) you can easily update CRM records (Account, Contact, etc.)...

Read More
Dependent Option Sets Updated for Dynamics 365

Dependent Option Sets Updated for Dynamics 365

Option sets in CRM are an easy way to ensure clean data. Limiting end user choices tends to streamline business processes and ensure uniform data...

Read More