Flow is brilliant! Forms are a great tool! Both combined allow for some quick and easy data gathering. Let's start by talking about Forms.
Microsoft released Forms a year or two ago with a basic premise, allowing end users to quickly and easily setup a web page to gather data and collate responses. You don’t need to be a developer or have access to a web server to host a Form, it’s all done through a WYSIWYG editor and hosted by Microsoft. Forms are included in various Microsoft packages so if you are an Office 365 user, most likely you have access to Forms.
As it’s a bundled in with most packages (not free, for all, exactly), there’s not a lot of complexity to it; you create a page, publish/share it, it gathers the responses and you can look at the data in the backend or export to Excel. Some would call this basic, I personally call this functional as it just works.
Now let's move onto Flow. If you haven't heard of Flow, HAVE YOU BEEN LIVING UNDER A ROCK?!?!?! Think of Flow like WorkFlows (get it?) in D365, it allows you to automate processes but it’s so much more than just a single system. Flow gives you access to connectors, allowing you to connect from various sources to other sources to move data, create/update records, send emails, tweet, trigger workflows (sort of) and more. For example every time an Opportunity is won in CRM, Tweet to the public, upload documents to SharePoint and Email the Senior Management Team with the details. All done with a no code solution.
If I haven’t piqued your interest yet then maybe this blog isn’t for you. But if you are still reading this, then you know where I’m going with this, Forms and Flow, a match made in heaven, like hotdogs on toast….or a Sausage Roll Sandwich...wait, you haven’t tried either of those? They are delicious.
Anyway, as you can’t do much with the data in Forms and D365 has the capabilities to use that data in multiple ways, the best idea is to get that data in there in the quickest and easiest method. Now you could just download the result periodically and strip out any duplicates and upload them, but that’s too much effort and where’s the fun in that. Instead, lets use Flow and get that data into D365 in near real time.
Firstly, lets build a Microsoft form. Head over to Forms and sign in. You should see this page. Click on “New Form”.
From here, it’s a simple editor to add questions, you just need to add the type of Question/Response that you want, put in the details of the question and if it’s required or not. It’s very simplistic so I’m not going to write a whole tutorial on building Forms.
Once you are happy with all your questions (baring in mind you want to put this data into D365 so think about your datamodels and fields) you can preview the Form (both computer and mobile, a cool feature) and Share it.
Now comes the fun part, log into Flow, go to My Flows and Create blank
On the next screen you are going to be asked for your trigger, again, if you are familiar with Workflows in D365 this shouldn’t be too difficult or unfamiliar. We are looking at how this flow will be triggered, what criteria needs to be met before we run our actions. As you can see from the screenshot below, there’s quite a few built already.
The search bar at the top will allow you to search through all the triggers available, with more being added all the time. Search forms and you should see a Microsoft Forms trigger - “When a new response is submitted”. Choose this and from the drop down you see next, choose the Form you just created.
Once you have done this we then need to add an apply to each step. Click on the “Next step” button just below where you are , click the elipses and you can add apply to each step. The below screenshot shows you some of the other functionality available for reference.
In the apply to each, click the box and you should see the dynamic menu open on the right with a list of options. In this case, we want to choose “List of response notifications”.
Add a new step and choose add an action. Type forms into the search box and find the “Get response details”. In the Form Id box choose your form and in the Response Id, again you will see the dynamic content box and choose Response Id.
But why do we need to do this step I hear you cry! It basically get’s the responses to the form so that we can use them in a later step. Trust me, it took me a few minutes to figure out why I couldn’t get any data later on and this was the solution.
Next we’re going to connect to D365 and create a record. Add another step and another action, this time search for Dynamics 365 and choose “Create a record”. You need to select your Organisation name and your entity that you want to create this record in. At this point, you may be prompted to sign in again to your tenant just to say you are who you say you are.
Once you fill in this information, your window will expand and show you all the fields on you entity once you have clicked “Show advanced options” allowing you to populate anything you wish.
Remember earlier when I said, make sure you pay attention to your datamodel and fields? Why’s this important? Well, unlike when you use the D365 API to inject data and it disregards field requirement, Flow does not, in fact, it enforces it. If your field is required in Dynamics 365, it’s required here too!
Here’s where we use the fields you created in your form and put them into Dynamics 365. Find the fields where you want to populate information, click in them and in the dynamic menu you will see the questions/responses from your form and add them in.
Once you are done, you should have something that looks similar to this.
Once you are happy with all the data, click save and you can test it. Flow allows you to test your Flows so you can see that it’s all working, click test and select the option “I’ll perform the trigger action” and once that’s selected, go back to your Form that you created, fill it out with some information, submit it and you should see that the Flow runs through it’s steps and it will either pass or error and tell you where it errors.
Once you have tested the Flow once, the other option “Using data from previous runs” will be available, meaning you don’t have to constantly trigger the Flow yourself, it will simply use the same criteria and run your Flow. How cool is that?
What you should end up with is a Form, triggering a Flow, pumping data into your Dynamics 365 system for your users to see. What’s more, no development costs, no web server costs, no need to get your marketing company to embed some custom script into your website which costs more than your last holiday.
This is a very, very basic use of Flow, it barely scratches the surface of what the technology can do, but hopefully this gives you a little taste and maybe makes it a little less scary for you to try.
Ciao for now!