Let your custom Agent search Knowledge Articles in Dynamics 365!
Wouldn’t it be great if your custom agent could do more than answer questions? If it could actually help customers resolve their issues without ever needing to chat with a live agent or search through pages of knowledge articles by themselves? By giving your custom agent access to the knowledge base in Dynamics 365 Customer Service, you’re doing exactly that. With the help of Power Automate, you can use an existing flow that allows agent to search and retrieve relevant knowledge articles based on what the customer is asking, automatically and in real time! This means your customers get the answers they need faster, without having to wait to get connected to a live agent or figure out the right search terms. At the same time, your customer service team sees fewer tickets, giving them more time to focus on complex or high-priority cases. It’s a win-win: customers feel empowered and supported, and your team becomes more efficient and effective. And the best part? You’re using the tools already available in Dynamics 365 and Power Platform to make it happen, no custom code or massive overhaul required. In this article I will discuss how you can set this up today!
Configure Search Dynamics 365 knowledge article flow
As I mentioned before, this power automate flow is already part of the environment, all you have to do is replace the connections in the connection references, turn it on and add it to a custom agent in Copilot Studio! Let me explain how you can do that. In order to access the power automate flow you will need to navigate to make.powerautomate.com and open the default solution. Under ‘Objects’ enter ‘Cloud Flows’ and then search for the ‘Search Dynamics 365 knowledge article flow‘. (Make sure you are in the right environment!). Open the power automate flow in a separate window. When the flow opens, you will see the red exclamation points on the right side of the connection references, meaning the connections need to be configured. I will explain how to do this, but first we need to get the name of the connection references so we can connect them to a proper connection. To get the name, hover your mouse over the connection reference and you’ll see the name show up. Write down the name for both the Dataverse (msdyn_Dataverse) and Content Conversion (msdyn_ContentConversion) connection references.

Go back to the default solution and under ‘Objects’ search for connection references. Click on it to see all the connection references stored in the solution. On the top right enter the name of the first connection reference. In my example that is the Dataverse connection reference, called ‘msdyn_Dataverse’. Click on the three dots on the right side of the display name and select ‘edit’. This will open a pane on the right side of the screen where you can select a connection in your environment. If there is no connection available, click on ‘+New connection’ to create a new Dataverse connection. Once the connection is created, click ‘refresh’ in the side pane and select the connection, then click ‘Save’. Repeat these steps for the Content Conversion connection reference. Once both connections are configured, navigate back to the power automate flow and refresh the screen. You should see two green checkmarks now next to the connection reference. Turn on the flow by clicking the ‘Turn on’ button. NOTE: This flow is not customizable which means if you want to make changes to it, you will not be able to. Instead, you can make a copy of the flow and use the new flow (with your changes) instead.
Create a new agent or configure an existing one
Now that the power automate flow is ready to be used, we need to add it to the custom agent using Copilot Studio. Open Copilot Studio by navigating to copilotstudio.microsoft.com. Make sure you are in the right environment! Click ‘Agents’ on the sitemap on the left and open your custom agent or create a new one! Since I am using this functionality with a custom agent that sits on a website, I don’t need people who engage with the agent to authenticate. To disable authentication, click on ‘Settings’ on the right side of the screen and select ‘Security’ on the left side. Then access ‘Authentication’ by clicking on the arrow on the right, select ‘No authentication’, and hit the ‘Save’ button. You’ll see a warning popping up, click ‘Save’ again and close the page. I don’t want the agent to use generative AI so I disable orchestration, (you can do this on the ‘overview’ page of the agent) and I need to turn off the ability for the AI to use its own general knowledge so that it will use my knowledge articles as a source. To do this I open the ‘Conversational boosting’ topic under ‘Topics’ and edit the data sources in the ‘Create generative answers’ node. From there I turn of the ability for the AI to use its own general knowledge.
Add knowledge search topic
Now that I’ve configured my agent, I can add the ‘Search Dynamics 365 knowledge article flow’ to a topic. I can add the power automat flow to individual topics, or I can create a new topic and redirect other topics there, which is what I am going to do. To create a new topic, navigate to ‘Topics’ in Copilot Studio, then click the ‘+ Add a topic’ button on the top. I change the name of the topic to ‘Knowledge Base Topic’. I am not entering any phrases under the trigger node, as I will redirect other topics to this new one. What you might not be aware of, is that I have the ability to filter the knowledge articles the power automate flow surfaces, as the flow contains a filter. Since I don’t want customers who interact with the agent to have to enter a filter, I will pre-populate it in the topic. Click + to add a node and select ‘the ‘ ‘Variable Management’ . “Set a variable value’. Click on the arrow under ‘Set Variable’ and select ‘Create a new variable’. This will show as ‘Var1 unknown’ in ‘Set Variable’ node. Click on ‘Var1’ and change the variable name to ‘Filter’. In the ‘To value’ paste statecode eq 3 and isinternal eq false. This will filter the knowledge articles from Dynamics 365 to only return articles that have a status of active and where the ‘lnternal’ field is set to ‘No’, excluding any internal articles. You can change the filter to match your requirements if needed.
I will now add the ‘Search Dynamics 365 knowledge article flow’ node as an action. Click on the ‘+ button’ below the last node, then select ‘Add a tool’. You should see the flow in the list or you can search for it by name. Click on the flow to add it. Click on ‘Enter or select a value’ below the ‘Search Text’ variable and click on the ellipse to select the ‘Activity.text’ variable below the ‘System’ tab. The next step is to set the “Filter’ variable. Click on the ellipse next to ‘Enter or select a value’ below the ‘Filter’ variable and select the ‘Filter’ (Topic_Filter) variable. Since we’re using this flow as a redirect from another topic, we want to be able to send the results of the query (the knowledge article(s) it found, back to the original topic. On the action, below ‘Outputs’, click on the gray colored ‘textresults’ variable to view or change the properties. Make sure the ‘Return values to original topics’ under ‘Usage’ is checked as shown in the image below and save your topic.

Redirect Knowledge Base topic from Fallback topic
The last step here is to redirect the Knowledge Base topic we created in the previous step, from the Fallback topic. The fallback topic is triggered if the AI agent doesn’t understand the intent of the person who is interacting with the agent, and we want the agent to show any relevant knowledge articles to the customer in this case. To configure this, I need to open the ‘Fallback’ topic in Copilot Studio. Below the ‘FallbackCount’ condition, I click the + button and select ‘Topic Management’ > ‘Go to another topic’ and select the ‘Knowledge Base’ topic we created earlier. I want to add a condition in case there are no knowledge articles found, so below the redirect node I add a condition. Click on the arrow next to ‘Select a variable’ and select the ‘Textresult’ variable. I click on the condition “currently set to ‘is equal to’ and I select ‘is not Blank’. Below that I add a new message node where I enter: ‘Here is a knowledge article(s) I found: ‘. To add the actual knowledge articles, click on the {x} icon and select the ‘textresults’ variable. This will enter the article(s) that were found from the knowledge base topic. Below the message node I add a redirect node to the ‘End conversation’ topic. I click on the existing message that reads: ‘I’m sorry, I’m not sure how to help with that. Can you try rephrasing?’ and click ‘cut’ (the scissors icon) on the left top of the screen. Below the ‘Other conditions’ I click the + button and select ‘Paste’, which will add the message we just copied.
And that’s it! With just a few configurations in Power Automate and Copilot Studio, your custom agent can now search and surface relevant knowledge articles from Dynamics 365, no manual search, no developer effort, and no need for live agent intervention. It’s a simple but powerful way to deliver faster answers, reduce customer support inquiries and create a smoother customer experience using tools you already have. Now that your agent is connected to your knowledge base, all that’s left is to publish, test, and start delivering smarter self-service today!I hope you enjoyed this article! Be sure to check in again next week for a new article or subscribe here to never miss another post!



Comments are Closed