Grounding Copilot Studio Prompts on Dataverse Tables
This article explains how Copilot Studio grounds custom AI prompts on Dataverse tables, enabling precise, structured, and filtered data retrieval.

Understanding the Concept
Traditionally, Copilot Studio agents rely on unstructured knowledge sources, such as documents or web content, to generate responses. While effective in many scenarios, this approach can lead to generic or imprecise answers when dealing with structured business data.
By grounding prompts on Dataverse tables, you instruct the AI to reference specific datasets, ensuring that responses are contextually accurate and aligned with your business logic. This method is particularly beneficial when users need information filtered by certain criteria, such as region, date, or product category.
Implementing Grounded Prompts in Copilot Studio
1. Accessing the Prompt Builder
Begin by navigating to your Copilot Studio agent. In the left-hand menu, select Tools > Actions, then click on + Add an action and choose Prompt. This opens the prompt builder interface, where you'll define the behavior of your custom prompt.

2. Defining the Prompt
In the prompt builder, provide a clear and concise name and description for your prompt. This metadata aids in semantic matching, allowing the AI to associate user queries with the appropriate prompt.
Next, articulate the instructions for the AI in natural language. For example:
"Retrieve the list of products by supplier. Filter by supplier: SupplierFilter. Use data: StoreInventory.Supplier. Return StoreInventory.Name & StoreInventory.Quantity"
3. Incorporating Dataverse Tables
To ground the prompt on a Dataverse table, click on Add content or type /
within the prompt editor. This action allows you to select a Dataverse table, such as StoreInventory
, and choose the relevant columns (e.g., Name
, ItemId
, Quantity
) to include in the prompt.

4. Applying Filters with Input Variables
To enable dynamic filtering based on user input, define input variables. For instance, create an input variable named SupplierFilter
. Then, apply a filter to the Supplier
column by binding it to the SupplierFilter
variable. This setup ensures that the AI retrieves only the records matching the user's specified region.

5. Configuring Input and Output Parameters
In the Input parameters section, define the variables that will capture user inputs, such as RegionInput
. In the Output parameters section, specify what the prompt should return, like a list of customer names and emails. This configuration facilitates seamless data flow within the prompt.
6. Testing the Prompt
Utilise the Test prompt feature to simulate user interactions and validate that the prompt retrieves and processes the Dataverse data as intended. Provide sample inputs to ensure the AI responds accurately based on the grounded data.

7. Publishing the Prompt
Once satisfied with the prompt's performance, save and publish it to make it available for your Copilot agent. The AI can now leverage this prompt to provide grounded responses during user interactions.
Practical Use Case: Customer Lookup by Region
Consider a scenario where a user asks, "How much stock do we have from our supplier Fresh Farms Ltd?" With a grounded prompt:
- Input Captured:
SupplierFilter = "Fresh Farms Ltd"
- Dataverse Query: Search the
StoreInventory
table whereSupplier
equalsFresh Farms Ltd
. - Response: A list of products from the Fresh Farms Ltd supplier, displaying their names and quantities.
This method ensures that the AI provides a concise and accurate list based on the user's request.

Advantages of Grounded Prompts
- Enhanced Accuracy: By referencing specific Dataverse tables, the AI delivers responses that are contextually relevant and precise.
- Dynamic Filtering: Input variables allow for real-time data filtering based on user queries.
- Improved User Experience: Users receive tailored information without sifting through irrelevant data.
- Maintainability: Centralised prompts make it easier to manage and update data retrieval logic.
Conclusion
Grounding prompts on Dataverse tables within Copilot Studio empowers your AI agents to provide structured, accurate, and context-aware responses. This approach bridges the gap between unstructured AI interactions and structured business data, enhancing the overall effectiveness of your AI solutions.