AI Builder Deep Dive for Dynamics 365 Finance and Operations Process

Dynamics365FO_AIBuilder.png

Hello the Community !

Hope you are doing well. I thought my self that eventually I’ll post something new soon on my favorite topic (yes it’s often a new favorite topic with me !) but mostly after my previous article on Modern Data warehouse and Azure Synapse with D365 F&O, and if you have a look on my old articles on my blog, you have maybe seen that I also done some basic overview of Azure Machine Learning, especially Azure Automated ML. And YES, I love AI ! :) So that’s why I always try to put something new with you, the community, partner, customers on top of Business Applications.

Also I’m working on a book that will come in 2021 about Dynamics 365 + PowerPlatform for AI.

AI Builder in all is GLORY for all kind of process for Dynamics 365 Finance and Operations. How this new feature that had less than 1 year in Power Platform can really help you to better serve your user in their day-to-day in the ERP. As usual now, I’ll post at the end of the article a 4K DEMO YouTube VIDEO (for this topic it’s really great to show it for you in LIVE / theater model / Wowwwwww PreSales stuff but clearly here it’s working and it’s NOT like selling dream (if you know what I mean…)

First, as a reminder before showing a lot of use cases where I’ll present all available AI Builder in the PowerPlatform to handle ERP process management, let’s again give you a very quick overview of What is AI Builder ? ….


AI Builder is a Microsoft Power Platform capability you can use to improve business performance by automating processes and predicting outcomes. AI Builder is a turnkey solution that brings the power of AI through a point-and-click experience. With AI Builder, you can add intelligence to your apps even if you have no coding or data science skills.

One of the fundamental challenges with artificial intelligence is that it has historically been out of reach for the many. With limited access to highly sought after resources, drawn out development times, compounded with the added complexity of needing special purpose infrastructure to facilitate the AI development process, there has understandably been various barriers of entry for the broader user base to harness the types of capabilities that fall under the AI domain.

AI Builder is part of Microsoft’s ongoing efforts to democratize AI, empowering users of all skill levels to build, train, and publish AI models in a no-code, guided, point and click environment. It’s now in Global availability state, anyone can infuse AI within their business applications with PowerApps, or add intelligence to automated work processes with PowerAutomate, especially like in Dynamics 365 Finance and Operations use cases that we will see here after in this article !

The price is very cheap considering the amount of things you can do & help every month a lot of process automatically with that !

Around 400/500 €-$ per month for the whole tenant.

Also I would also suggest to go through the Microsoft Doc since it’s very fast to read & well explained :

To try you can of course already go to your Power Platform CDS environment and ask a Trial for 30 days. And as far as I’ve seen you can extend to more days of test. If you have on Dynamics 365 F&O instances, you have normally already a CDS environment for free (like me for few customers) so clearly you can go already to try it whenever you want without to be charged.

AIBuilder_D365FO.PNG

High-Level Process Flow

  1. Select a model type : Supported scenarios currently include Binary Classification, Form Processing, Object Detection, and Text Classification.

  2. Connect the model to data : AI Builder can train models based off data that resides within the Common Data Service.

  3. Configure the model : Follow the point and click model building wizard interface. No coding required.

  4. Train the model : This is an automated process handled by the AI Builder service, based on the previously provided inputs.

  5. Publish and use the model
    As an example, there are special AI Builder components available within PowerApps such as a Form Processor or Object Detector. These objects can be connected to a published model.

ai_builder_flow.png

Of course, you will share after only Power Automate Flow connected to your AI Builder model only in readonly and for some specific users.

Before jumping to every use cases, you can also go to see tutorials by Microsoft here :


So, here we go, let’s start first with a use case common in ERP system :

  1. FORM Processing with AI Builder / Showcase with Dynamics 365 F&O

Form processing lets you read and save information from standard documents such as invoices or tax documents or whatever documents you receive very often in your ERP Process (paper sheet or PDF files). When you automate this process, you can save valuable time by reviewing, extracting, organizing, and saving the data automatically by using Power Automate and Power Apps ; and of course in Dynamics 365 F&O instance at the end !

You will have to train your model and define the information to be extracted from your forms. You only need 5 form as examples/training documents to get started. Quickly get accurate results tailored to your specific content. With AI Builder, as already explained before, you don't need a lot of manual intervention or data science expertise.

Remember of course, the document need to be on the same format or mostly very similar, otherwise you can’t automate something like this…. :)

Form processing works on input documents that meet the following requirements:

  • JPG, PNG, or PDF format (text or scanned). Text-embedded PDFs are better, because there won't be any errors in character extraction and location.

  • The combined file size of the documents used for training must not exceed 50 MB, and PDF documents shouldn't have more than 500 pages.

  • For images, dimensions must be between 530 × 100 and 4200 × 4200 pixels.

  • For PDF files, dimensions must be at most 17 x 17 inches, corresponding to Legal or A3 paper sizes and smaller.

  • If scanned from paper documents, scans should be high-quality images.

  • Must use the Latin alphabet (English characters).

After you train and publish your model, you can use it in a flow in Power Automate or in a canvas app in Power Apps.

So first, go to AI Builder, and pick the model :

AIBuilder_FormProcessing.PNG
FormProcessing_D365FO.PNG

You can now pick sample examples files documents here if you want to test (or of course pick your own one)

Frist, upload your documents to train the model, next here is below the step-by-step process =>

You can see that it’s very easy to achieve ! You can of course after doing like me a Power Automate flow that can be run by a manual action from a user (upload PDF file) but as you know we can have a trigger action on Power Automate so like maybe when we receive an email with an Invoice by email or even when we scan manually in the office and we receive the file by email, we can call the Power Automate flow , extract the DATA wanted by AI Builder, and send them directly to Dynamics 365 F&O without any code ! You could also imagine an approval action in Microsoft Teams by a Manager before D365 if you want too. Or well, whatever you want since you have more than 300 connectors (cloud or OnPremise) with PowerAutomate so the use case can be almost illimited. Even if you don’t have on you can create Custom Connector for your own API.


2. Receipt-Expense Processing with AI Builder / Showcase with Dynamics 365 F&O

Yes this one is my favorite, clearly : especially if you are using the Expense Management module in Dynamics 365 F&O

For that, already try it in Private Preview few months back, be aware it’s still in Public Preview ! The main current limitation it’s only supported for US Receipt format and don’t for French or Europe format. But that’s said you could still try because in my case I didn’t see any problems and believe in France we have very strange different templates…

You want to automatically send, approve, create everything with the attachment without any actions from the user : well just one : push the file in their own OneDrive or take the picture via their smartphone, call it in Power Automate with the Mobile App and after everything is done for them.

AI Builder has now a model in Preview called Receipt Processing. Before to have this one, I try to use the Text Recognition on my own but it was very complex and long, now it will extract everything needed for you without actions or adjustments : Total Amout, Merchant Name, VAT etc….

For this one, you don’t have to train the model, since of course this model can handle different types of Receipt format from different merchant.

Just need to do the Power Automate or Power Apps.

I will pick on my side the Power Automate flow example, go to AI Builder again :

AIBuilder_Receipt.PNG
I will pick this flow example as a start for me

I will pick this flow example as a start for me

Below you can see, very simple, when we have a new file coming up in the Onedrive’s user, we call the AI Builder to process the file and create a new row in an Excel sheet file. But of course, at the end, we could call Dynamics 365 F&O instance (even add like often an approbation for the manager).

AIBuilder_Receipt3.PNG


And now a call example with my LinkedIn Receipt file. Please note that you have also every time the confidence (like every time in any Azure ML Model) it’s the percentage of scoring. So as a best practice, when you are not sure of the result, maybe you have to handle a degrated process (manual review) otherwise you will create false information to your ERP… That’s not a good idea…

AIBuilder_Receipt4.PNG

3. Business Card Reader with AI Builder / Showcase with Dynamics 365 F&O

While scanning Business Card for getting new contacts or leads are somehow mostly used for CRM Projects, like for CDS / Dynamics 365 CE, you can also use it with the same use case for Dynamics 365 F&O. Or both in fact, maybe you have using the Dual Write feature to sync the 2 Apps and when a new contact on an Account is created in your CDS, it will be sync to your F&O instance : so that’s why this AI Builder model is also relevant for this kind of topic !

As usual now, you need to select the AI Model :

AIBuilder_BusinessCard2.PNG

Again, using this AI Model in a Power Automate flow :

Of course, we will after share the flow to the end users, and they can pick the Mobile App of PowerAutomate and push the business cards when they were in a Business Event - Events (before COVID19 true but hopefuly again very soon…)

AIBuilder_AddDocuments10.PNG

It will be push to the CDS, but we can replace this part directly to Dynamics 365 F&O if we don’t have DualWrite activated.

Again and again :) , we can also put an approval process between if we don’t want to push Master Data and control that or also doing an Upsert request we don’t want to push duplicate records. !

AIBuilder_BusinessCard3.PNG

4. Prediction with AI Builder / Showcase with Dynamics 365 F&O

Hell yeahhh ! Now we can go deeper and dive !! Yes you have reading right, we can do also some transactionnal predictions with AI Builder !

Well, the tricky part is about Dynamics365 F&O. Here I have to manage the first limitation of this AI Model : we can only map it into a CDS Entity. As you maybe know, I’ve provided on my blog an article about CDS Virtual Entities without any sync with Dynamics 365 Finance and Operations. But at this time, you can’t still use them for Power Automate flow, and also for AI Builder. So you will need to use the Dual Write feature to sync the DATA from F&O to CDS, in order to predict something :)

AI Builder prediction models analyze patterns in your data, and learns to associate historical patterns with outcomes. Based on past results, the prediction model learns patterns, and detects them in new data to predict future outcomes.

Use the prediction AI model to explore business questions that can answered as one of two available options (binary), multiple possible outcomes, or where the answer is a number.

Binary prediction

Binary prediction is when the question asked has two possible answers - yes/no, true/false, on-time/late, go/no-go, etc. Examples of question that use binary prediction include:

  • Is an applicant eligible for membership?

  • Is this transaction likely to be fraudulent?

  • Is a customer a good candidate for a marketing campaign?

  • is an account likely to pay their invoices on time? - like Dynamics 365 Finance Insights ??? :)

Multiple outcome prediction

Multiple outcome prediction is when the question can be answered from a list of more than 2 possible outcomes. Examples of multiple outcome prediction include:

  • Will a shipment arrive early, on-time, late, or very late? - Very good for Dynamics 365 F&O use cases !

  • Which product would a customer be interested in? - Also good for ERP Process !

Numerical prediction

Numerical prediction is when the question is answered with a number. Examples of multiple outcome prediction include:

  • How many days for a shipment to arrive?

  • How many calls should an agent handle in a day?

  • How many items do we need to keep in inventory? - Oh yeah very good for Dynamics 365 F&O Inventory process !


Remember that :

  • Your data must be in Common Data Service.

  • Make sure your administrator has assigned you a security role with Read privilege over your data.

  • You need at least 10 records of historical outcome for each class of the Label data field to train a prediction model.

  • The minimum for training is 50 records, but for best results you should have at least 1,000 records.

So, now how-to work with that :)

First, in case of Dynamics 365 F&O for this AI Model I would recommend to use the Dual Write framework in order to push DATA to your own CDS environment. It’s the only way (easy in fact) to push transactionnal data and train your AI model. After every new row will be scored in real time with AI builder and you can sync it back to F&O or keep it in CDS for the results and maybe display it on a PowerBI Report or PowerApps or even send automatic PowerAutomate flow if results are under a certain score.

I would say that you can easily sync it your SalesInvoiceLines - S.Q Lines or S.O Lines or some Inventory transactions.

if you don’t want (yet) to train the model with the Dual Write F&O DATA, you could still use the sample DATA from Microsoft to test it right away.

For me, I used some CDS entities that were already part of the Finance Insights AI Model - in fact you will see that it’s exactly the same AI model used for this new AI App for Dynamics 365 F&O to generate customer payment predictions. Check back my article for that.

First thing to do, of course, it’s to pick the right CDS entity where you want to generate outcome prediction data.

And also most important, the Field ! Here it’s like an OptionSet for CDS ; with somehow a classification group : Late, Very Late, Ontime

AIBuilder_Prediction.PNG

Second, you select every fields needed to generate the AI Model. And yet, you have to pick also other related entity : often it’s master data (like production for SalesInvoices or Customers, Customers Group etc…)

Very important like said in my Finance Insights article, don’t select everything, but pick only relevant data otherwise the AI model will be less powerful that you want. Don’t worry at the end of the first training, you will see the most influencal data, and you will keep only fields where you have more than > 1%

AIBuilder_Prediction2.PNG

Here you will have the ability, to filters DATA (for F&O it could be based on Legal Entity) and keep all DATA. Remember that more DATA you have (volume), better will be the scoring performance AI Model results.

AIBuilder_Prediction3.PNG

Let’s now your first version of your prediction AI model.

AIBuilder_Prediction4.PNG

Now, you can see the result. You can still edit and try again, check the most influential data, your performance (like me 47% here it’s not great but it was an irrelevant topic DEMO test. After you can publish it when you want to use it.

AIBuilder_Prediction5.PNG

Last, you could - like every time - use it for a Power Automate flow.

AIBuilder_Prediction6.PNG

Here you can create a trigger flow on CDS current environment connector (CRUD operations) and ask to predict this new row in real time.

AIBuilder_Prediction7.PNG

5. Entity Extraction, Category Classification and Object Detection

For these 3 AI models, I don’t have any showcase in relation with Dynamics 365 F&O, but of course it can be used for other topics especially for in any PowerApps connected to your Dynamics instance. Like Object Detection could be useful for Warehouse Keeper.

If you want to learn more about it, please go ahead and check the Microsoft Doc for that :


6. Let’s go for further AI with Dynamics 365 F&O with Azure components…


Despite the fact that AI Builder in PowerPlatform could, really, help us to build quickly & deploy as easy and faster way you could ever imagine few years ago, you can still (will maybe) also deploy your own AI / ML Pipeline for Dyanmics 365 F&O Data.

The first thing as every SaaS components like this one, is to be aware of the limitation and the fact that you will not have any hand on what you will see. It’s not a blackbox, but still, you can’t customize it. You pay for the same service as every customers : like in fact Azure A.I Services.

I would say 2 best practices :

  1. Start first with AI Builder especially if an AI Model can be already used for D365 F&O Process in your organization. You can already test it as no charge and will see very fast results (since you will not have to hire 10 data scientists for that… :))

  2. If it’s not work as expected or even if you see bad results or/and after few months in PROD you think that you want to invest much more with your OWN AI Model, we can go ahead with those kind of A.I Services / Architecture for D365 F&O Process that I will present just after.

Source : Microsoft documentation

Source : Microsoft documentation


I will go through the 3 AI Services in Azure that we’ve got so far :

  1. Cognitive Services

  2. Azure ML / Automated ML

  3. Bot framework

For the last one, it’s a great example on exactly the same thing that I’ve told you before, should I use the Power Virtual Agent or go directly deep with Azure Bot Framework. So the answer will be the same as AI Builder versus Machine Learning. Keep it simple first, try it first with Power Platform you will see after if you want to go in the deep dive of Conversational AI. But like presented in my old article for Power Virtual Agent for Dynamics 365 F&O, it’s again a faster way to deploy a bot for your ERP Process without to spent 3 months of project (if you know what I mean….)

For Cognitive Services, it’s again like AI Builder pre-built API for you, by Microsoft. Well, AI Builder has again provided an end-to-end interface to call this kind for some same services. So you will see them that exactly do the same purpose for you : Cognitive Services bring AI within reach of every developer—without requiring machine-learning expertise. All it takes is an API call to embed the ability to see, hear, speak, search, understand, and accelerate decision-making into your apps. Like Computer / Face vision can be compared as Object Detection of AI Builder. Form Recognizer could be very similar as Form Processing of AI Builder…

But, some A.I Services, are only present (at this time) on Azure and not on Power Platform - A.I Builder.

For those kind of services, you will need a developper to call this API in real time and also to train the model first with your own DATA. So a little+ job to do before using it but still you will not have to deploy & build your own AI Model. So let’s see that as an intermediate challenge !

For Dynamics 365 F&O, I will see these services that can be used in a lot of ERP process :

  • Custom Search / Personalizer / Auto suggest that you can add directly for the end-users in ERP to propose a more “personalized” experiences in the tool.

  • Anomaly detector for the Assets Management module / Maintenance process / Production

  • Sentiment Analysis between Dynamics 365 Customer Voice and your Dynamics 365 F&O synchronized.


For custom Azure A.I model for your ERP, you could go ahead with Azure Machine Learning and especially first with the new feature called Azure Automated ML.

It was almost 1 year ago that I’ve presented in my starting blog this new component. It was also my first session for an event for 365 Saturday in Paris…

And yes you could read it first before jumping to the end of this article :

Microsoft has also released a ML .NET Core opensource project that you can use especially for Azure Automated ML feature.

I would suggest every developpers to read it carefully since it’s a good framework to start with. You can start to build your AI Model very quickly and also use directly as an API Services and build a Custom Connector for the Power Platform to be available for every one in your organization - even citizen developper.

For and end-to-end global AI architecture for F&O for large organization and for large datasets with also Data scientists in the team, you can go with this kind of flows. First imagine you are using Dynamics 365 Commerce (Retail) with Dynamics 365 F&O instances with P.O.S Purchases and reviews on your online store.

You could imagine to push your ERP data (like in my Modern Datawarehouse Article for F&O) to an Azure Data Lake (below Azure Storage) in real time.

Every data scientists could after see the DATA in the Databricks components (for the DTWH it was instead the Synapse Analytics for PowerBI) and start doing Data Mining to propose a Custom AI Model in Azure ML Services.

This custom AI model & pipeline will be very easy to deploy with Azure Kubernetes Services so that every other users in your online store would see recommandations based on the other user and item ratings.

D365FO_Databricks.png

Hope you liked this global A.I article for Dynamics 365 F&O process !

See you next time and take care !

Here is also the Youtube 4K Demo Video :