AP Automation in Dynamics 365 Finance and Supply Chain

As a solution architect, prospects and clients often ask me for ways to improve their Accounts Payable process.  They receive hundreds of invoices every month, and it can take considerable amount of time to enter all of the detail as well as attaching the invoice for reference during the approval process.  This is an area where we have often needed to bring in an ISV solution, but that could cause other issues.  Microsoft has been doing considerable work around automation for AP and they recently released a public preview of their Invoice Capture solution. I have had the opportunity to set this up in one of my test environments so I could get an idea of what they have to offer.  As we would expect, the Invoice Capture solution is built on the Power Platform.  It uses a model driven Power App along with Power Automate Flows to integrate with Dynamics 365 Finance.  However, since it is a solution, they have done much of the work for you, including creating the standard flows to load the

Creating a Sales Assistant using Power Virtual Agent and Dynamics 365 Finance and Supply Chain

As I continue to learn more and more about Power Platform, I have been intrigued by Power Virtual Agent.  However, I have not spent too much time with it because I could never come up with a business scenario around Dynamics 365 Finance and Supply.  Whenever I think about a “Bot”, I think about the annoying little boxes that pop up on some websites trying to help me, and I just could not think of how I would use that with D365.  

Recently as I was reading through various blogs, I learned I did not need a website to use Power Virtual Agent.  I could use the Bot inside of Microsoft Teams.  I also ran across an article from Henrik Marx Larsen https://henrikmarxlarsen.wordpress.com/2020/03/13/creating-a-customer-service-bot-for-dynamics-365-for-finance-and-operations-using-power-virtual-agents/ where he created a customer service bot with Dynamics 365.  I decided I would try to create a Sales Assistant to quickly answer some common questions that the sales team might ask the accounting team.

My goal was to create a Bot that could quickly retrieve information about customers from Dynamics 365 Finance, specifically the Accounts Receivables module. 

·         Customer Phone Number

·         Customer Primary Contact

·         Customer Balance

·         Customer Credit Limit

·         Customer Aging Information

Now that I understand the topics, I would like the Bot to handle, I am ready to get started.

Getting Started

To get started I created a trial account for Power Virtual Agents at www.powerva.microsoft.com, and created a new bot.  


Power Virtual Agents creates the Bot with some basic topics including a standard greeting.  I decided to start by creating my different topics.

Creating a topic to get information from Dynamics 365 Finance

Step 1 – From topic screen – New Topic

Step 2 – Create trigger phases and description to the topic

Step 3 – Design topic in the authoring canvas

In the authoring canvas you will plan out the flow of the Bot, including how the Bot will respond, what questions it will ask, and how it will get the answers to the questions.

A. Enter the message the BOT will return after the trigger phrase


B.  For the BOT to answer the question, it will need more information.  In this case, it will need the Customer Name, so you need to add a question to ask for the information.

C. Now that the BOT has the customer name, it needs to go to Dynamics 365 Finance & Operations to find the customer phone number.  This is done using a step of "Call an action" which uses a Power Automate Flow.

D. Create a Flow to take the input of the Customer Name, find the record in Dynamics 365 and return the Phone Number and any other fields you are interested in.

E. Once the Flow is created with the final step returning values to Power Virtual Agent, save the flow and return to Power Virtual Agent.  Confirm the Power Automate inputs gets value from the input variable created above when it asked for the customer name.

F. Now that the info is available, the next step is to have the BOT return a message with the response.  The variables can be part of the response.


G. The final step of the topic is to close it out.  This can be done multiple ways, including a message saying goodbye, a redirect to another topic, or possibly another question.

Step 4 – Design next topic in the authoring canvas

Continue in the authoring canvas designing topics until the BOT covers the topics required.


Step 5 – Deploy the BOT to Microsoft Teams

After the authoring is complete – be sure to save the BOT.  The next step is to Publish the BOT


Once the BOT is published you can share the BOT with team member and configure channels.  Microsoft Teams is a Channel.

Simply select Microsoft Teams and turn the BOT in on Teams.  This will add the BOT as a channel in Teams.


The BOT is now available for you to open in Microsoft Teams.  To share with other team members, it will need to be submitted for admin approval.


Popular posts from this blog

Creating a date table with a fiscal year in your Power BI data model

Showing the last 12 months based on a date slicer

Adding a new entity to Dual-write in Dynamics 365 Finance