Embed Microsoft Forms in your website and get leads in Dynamics 365 CRM without writing code



We come across frequent requirement where customers ask to create a custom page and embed it in their website and write logic to get leads into Dynamics 365 CRM.

In this blog, I have explained how without coding we can achieve this requirement.


Traditional Approach

We will create custom HTML page and create custom service hosted somewhere and then using JavaScript we will make a call to the web service and create respective records in CRM.

Alternative Better Approach

We can use Microsoft Forms & Microsoft Flow and without coding we can get the lead data inserted into Dynamics 365 CRM.

How-to Steps


  1. You should have D365 CRM (Sales) license.
  2. You should have access to Microsoft Forms (refer References section for the same).
  3. You should have access to Microsoft Flow.

Create Microsoft Form to get Lead Information

  1. Login to https://portal.office.com and open Forms from Admin Center.


  1. Click on New Form


  1. Name the form and keep adding questions.


  1. This is my form


  1. Click on Share option and select Embed option.


  1. Copy the Iframe tag and include it in your web page.
  2. That’s it. Your form is ready.

Create Microsoft Flow to insert response in Dynamics 365 CRM.

  1. Go to Flow from admin center.


  1. Select CREATE FROM BLANK option. Give some name to Flow.
  2. Search for Microsoft Form in connector and select Microsoft Forms – When a new response is submitted


  1. Select your form.


  1. Click Next step and select Add an Action.
  2. Search for Microsoft Forms and select Microsoft Forms – Get Response Details
  3. In the configuration put below formula as per below screenshot.



Refer this blog to understand above formula.

  1. Click on Next step and select Add an Action.
  2. Search for Dynamics 365 and select Dynamics 365 – Create a new record (V2)
  3. Select Organization.


  1. Select entity as Leads. It will show the fields of Lead entity as below.


  1. Click on Last Name textbox and select Last Name option from the right pane as per below screenshot. Repeat same steps for other fields.


Note: Click Show advanced options to see optional fields.

  1. That’s it. Finally click on Create Flow.

At this stage you are ready. You can start entering data in your form and it will automatically get inserted into Dynamics 365 CRM near to real time.


  1. Know more about Microsoft Forms



  1. Frequently asked questions about Microsoft Forms




Can I still get CRM Online trial of older version?


As Microsoft keeps releasing new versions of Dynamics 365/CRM, we should be prepared for the new features; but it is frequent requirement that, when we are about to test our customizations on older versions, and we register a trial, we get surprise of the newly released version. So, how can we test our customizations on the version we were expected?

This blog explains how can we achieve this.

Follow below steps to get older version of Dynamics CRM Online versions

  1. Visit https://www.microsoft.com/en-us/dynamics365/sales-trial and get started and sign up for new trial.
  2. Once you create new online environment, it will be the latest version of Dynamics 365 CRM.
  3. Go to https://portal.office.com > Admin Center.

admin center

  1. In Admin Center, click on Dynamics 365.

dynamics 365 in admin center

  1. You will see something like below:

instance manager

  1. Click on Edit. Change the Instance Type to Sandbox. Click Next & Save. After this step, you will see something like below.

sandbox options in instance management

  1. Click on RESET. You will get option to select Target Version.

target versions

  1. Select the version you want and click Reset. That’s it.

Invalid stage transition. Transition to stage {0} is not in the process active path.


With latest release of Dynamics 365, Microsoft has restricted skipping BPF stages and throws above error. When we try to change BPF stage programmatically and if we skip any BPF stage, then user will get above error.

Understand the error with the help of an example

Let’s say we have below Business Process Flow on Opportunity.

sample BPF

With D365, only below transitions are allowed.

  1. Qualify to Develop
  2. Develop to Propose
  3. Propose to Close

Below transitions are not allowed.

  1. Qualify to Propose
  2. Develop to Close
  3. Qualify to Close

How my earlier code (prior to D365 release) worked and suddenly stopped working?

Before D365 release by Microsoft, the above scenarios were considered as unsupported and there were no restrictions forced by Microsoft. Hence our code used to work in these unsupported scenarios as well. With D365 release, Microsoft has restricted these unsupported scenarios and users will start receiving the error with same code.

How have I come to this conclusion?

  1. I got the error log file with error code and same error code (-2146885629) is now available in SDK (you can search in CHM file).

SDK Error Code

  1. I raised a support ticket with Microsoft and as per confirmation from MS Support, it has turned out to be by-design. I received below response from MS Support Team.

Reply from MS Support

Note: Even though Microsoft has mentioned Environment as CRM Online, as this is by-design in D365, it applies to CRM On-premise deployments as well.


  1. After thinking about these unsupported scenarios, it makes sense to use logical branching to skip the stages if needed and if not, then we should follow the path mentioned in BPF.
  2. The resolution to this issue can be programmatically iterate the record through all the stages or use conditional branching in BPF.