How to Use Dataverse as a Knowledge Source for RAG in Copilot Studio Prompt Actions

This article explains how to add Dataverse as a knowledge source to Copilot Studio and AI Builder prompts.

スポンサーリンク

Prerequisites

Let’s consider a scenario where you have a “Cat” table in Dataverse like this, and you want to use this information to generate responses (RAG) from prompt actions.
Screenshot of a Dataverse table with cat information including names, ages, and descriptions

Adding Dataverse as a Knowledge Source to Prompt Actions

First, select [Add an action] and then choose [New prompt],
Screenshot showing how to select New prompt from the Add an action menu in Copilot Studio
From the [Knowledge] icon on the right side, select [Add knowledge], and choose the target table.
Screenshot showing how to add knowledge and select a Dataverse table
Since this is just a sample, we’ll use it without applying any filters.
*Note: In production, filtering only data used for responses (such as those with “Active” status) would likely improve response accuracy.
Screenshot showing the filter options for the Dataverse knowledge source
Then add the cat’s name as an argument,
Screenshot showing how to add a cat name argument to the prompt
Screenshot showing the argument configuration panel
Enter your prompt, click [Add] and select [In my prompt], then choose the [Cat] table you added.
Screenshot showing how to add the Cat table to the prompt template
You’ll then be able to select columns from the “Cat” table,
Screenshot showing column selection from the Cat table
Add all columns that you think will be necessary.
*Note: The effect of prompt formatting like “# Basic Information” on accuracy has not been verified.
Screenshot showing the completed prompt template with all necessary columns

This completes the implementation.

Testing the Implementation

From the [Input] icon in the top right, enter the name of a cat that exists in your table as sample data, and click [Test prompt],
Screenshot showing how to test the prompt with a cat name input
The system will generate a response based on the information from Dataverse, like this.
Screenshot showing the generated response based on Dataverse information
By the way, if you click [Show used knowledge],
Screenshot showing the Show used knowledge button location
You can check what information (Dataverse records) was used to generate the response.
Screenshot showing the Dataverse records that were used as knowledge

Including Links to Dataverse Records is Also Possible

If you check [Include links in responses] in the [Settings] icon,
Screenshot showing the Include links in responses checkbox in Settings
You can include links to the records used to generate the response.
Screenshot showing a response with links to the Dataverse records

Following Relationships is Also Possible

For example, when you have a table that contains multiple meal history records for each cat (one-to-many relationship),
Screenshot showing a one-to-many relationship between cats and meal history records
By selecting [Cat] from [Add], you can choose related tables (Cat (Meal History)),
Screenshot showing how to select related tables from relationships
This allows you to include information from related tables like this.
*Note: It appears possible to access multiple relationship levels such as “Cat” → “Meal History” → “Cat Food”.
Screenshot showing the prompt template with related table information included
When you test it, it provides the most recent meal history.
Screenshot showing the response including recent meal history information
Of course, you can generate responses that take multiple pieces of information into account like this, which makes it very useful.
Screenshot showing a comprehensive response incorporating multiple related data points

So, when generating responses using Dataverse records, I recommend using prompt action knowledge as it’s straightforward and effective.

Related Articles

Copied title and URL