Alphavima Technologies

April 27th, 2026

How to Build a Microsoft Copilot Studio Agent Connected to Dataverse

Microsoft Copilot Studio is transforming how organisations interact with their data. Instead of building complex chatbots from scratch, you can now create intelligent agents that read, filter, and even update your Dataverse tables — all through a no-code or low-code interface.

In this guide, you will learn exactly how to build a Copilot Studio agent that connects to Dataverse, retrieves records based on user input, and responds with real-time business data. Whether you are managing customer cases, tracking inventory, or surfacing employee information, this approach brings AI-powered conversations directly to your operations.

What You’ll Build: A functional Copilot Studio agent that accepts a user query, looks up matching records in a Dataverse table, and returns a structured response — all without writing custom code.

What Is Microsoft Copilot Studio?

Microsoft Copilot Studio (formerly Power Virtual Agents) is a low-code platform for building AI-powered agents and chatbots. It integrates natively with the entire Power Platform ecosystem — including Dataverse, Power Automate, and Power Apps.

In 2025, Copilot Studio introduced Autonomous Agents and Topics powered by generative AI, making it significantly easier to connect agents to structured business data.

For more background on working with Dataverse programmatically, see our guide on retrieving Dataverse records in Power Apps Code Apps.

Prerequisites

Before you begin, make sure you have the following:

  • A Microsoft 365 or Power Platform licence with Copilot Studio access
  • A Dataverse environment with at least one table containing data (e.g., Accounts, Cases, Products)
  • Maker permissions in the Power Platform environment
  • Copilot Studio enabled in your tenant (check via the Power Platform Admin Centre)

How It Works

The agent follows a simple three-step pattern:

  1. User inputs a query (e.g., “Show me open cases for Contoso”)
  2. Copilot Studio triggers a topic that calls a Dataverse connector action
  3. The agent formats and returns the matching records to the user

This pattern works in Microsoft Teams, SharePoint embedded web pages, or any channel where Copilot Studio agents can be deployed.

Step 1: Create a New Agent in Copilot Studio

  1. Navigate to copilotstudio.microsoft.com and sign in.
  2. Click Create in the left navigation pane.
  3. Select New agent.
  4. Give your agent a descriptive name — for example, “Dataverse Query Bot”.
  5. Set the language to English (or your preferred language).
  6. Click Create.

You will land on the agent canvas. You will see a default Conversational Boosting topic already configured. Leave this for now — you will add a custom topic next.

Tip: Enable Generative AI under Settings > Generative AI if you want the agent to handle off-topic questions gracefully using your knowledge sources.

Step 2: Create a Custom Topic for Data Queries

Topics define how the agent responds to specific user intents. You need one topic that handles a data lookup request.

  1. In the left pane, click TopicsAdd a topicFrom blank.
  2. Name the topic “Look Up Record”.
  3. In the Trigger Phrases section, add the following example phrases:
    • Show me records for
    • Find account
    • Look up case
    • Search Dataverse
  4. Click Save.

These trigger phrases teach the AI when to activate this topic.

Step 3: Add an Entity for User Input

To make the query dynamic, you need to capture what the user is searching for.

  1. Inside your topic canvas, click the + icon below the Trigger node.
  2. Select Ask a question.
  3. In the Ask field, type: What record would you like to look up? Please enter a name or keyword.
  4. Under Identify, select User’s entire response.
  5. Save the variable as UserQuery (under Save response as).

This stores whatever the user types as a variable you can pass to Dataverse.

Step 4: Connect to Dataverse Using a Connector Action

This is the core step where Copilot Studio queries your Dataverse table.

  1. Below the question node, click +Call an actionConnector.
  2. Search for Microsoft Dataverse in the connector list.
  3. Select the action “List rows”.
  4. When prompted, create a new connection using your environment credentials.
  5. Configure the action:
    • Table name: Select your target table (e.g., Accounts)
    • Filter rows (OData): Enter contains(name, '@{Topic.UserQuery}')
    • Select columns: Enter accountid,name,emailaddress1,statecode
    • Top count: 5 (limits results to avoid overwhelming the user)
  6. Save the output variable as DataverseResults.

Important: The OData filter dynamically injects the user’s input into the Dataverse query. Always sanitise inputs in production environments to avoid unexpected results.

For more on building Power Apps that query Dataverse, see our Power Apps Code App tutorial.

Step 5: Parse and Display the Results

Now you need to take the raw Dataverse response and show it to the user in a readable format.

  1. Below the connector action node, click +Send a message.
  2. Use a message template that outputs the name and email for each returned record.
  3. Add a Condition node before the message: check if Topic.DataverseResults.value has items. If empty, send: “I couldn’t find any matching records. Please try a different search term.”

Tip: For production use, consider sending results as an Adaptive Card for richer formatting — especially if deploying to Microsoft Teams.

Step 6: Test the Agent

  1. Click the Test button in the top right of the canvas.
  2. In the chat pane, type one of your trigger phrases — e.g., Find account Contoso.
  3. The agent should ask for your query, then return matching Dataverse records.
  4. If results appear blank, check your OData filter syntax and verify the table has data.

Common issues:

  • 401 Unauthorised: Your Dataverse connection is using the wrong environment. Re-create the connection.
  • Empty results: Check your column names match the Dataverse table schema exactly.
  • Trigger not firing: Add more varied trigger phrases in the Topic.

Step 7: Publish and Deploy

Once you’re happy with the agent’s behaviour:

  1. Click Publish in the top navigation.
  2. Select your deployment channel:
    • Microsoft Teams — Deploy directly to your organisation’s Teams instance
    • SharePoint — Embed via web part
    • Website — Copy the embed script to your portal
  3. Follow the channel-specific setup wizard.

For Teams deployment, go to Settings → Channels → Microsoft Teams and click Turn on Teams.

Best Practices

  • Use environment variables for your table names and filter logic so the agent is reusable across environments.
  • Limit returned columns in your OData query to keep responses fast and clean.
  • Add error handling using Condition nodes to catch empty results or connector failures.
  • Use Adaptive Cards when deploying to Teams for a professional, structured display of records.
  • Monitor usage via Copilot Studio’s built-in analytics to identify high-volume topics and optimise them.

Conclusion

Building a Copilot Studio agent connected to Dataverse is one of the most impactful things you can do with the Power Platform today. In just seven steps, you have created an intelligent agent that accepts natural language input, queries live business data, and returns meaningful results — no custom development required.

This pattern extends well beyond basic record lookups. You can apply the same approach to updating records, triggering Power Automate flows, or surfacing aggregated analytics. Combine it with Power Automate flow versioning for a fully governed, auditable automation strategy.

Ready to take this further? Contact the AlphaVima team to discuss how Copilot Studio agents can be tailored to your specific business processes.

Do I need a premium Power Platform licence to use Copilot Studio with Dataverse?

Yes. Copilot Studio requires a Microsoft Copilot Studio licence (standalone or bundled with Microsoft 365). Dataverse capacity is also consumed per interaction. For full licensing details, see Microsoft's official Copilot Studio licensing guide. You can also review costs before committing to a rollout.

Can a Copilot Studio agent write data back to Dataverse, or is it read-only?

Copilot Studio agents can both read and write Dataverse data. You can create, update, or delete records using Power Automate flows triggered by the agent, or by using the built-in Dataverse connector actions directly within a topic. Always scope your agent's permissions carefully to avoid unintended data changes.

How do I handle authentication so the agent only shows data the user is allowed to see?

Copilot Studio supports end-user authentication via Azure AD (Microsoft Entra ID). When you enable user authentication on a topic, the agent passes the signed-in user's identity to Dataverse, which then applies the standard Dynamics 365 security roles and record-level permissions. Users can only see what their security role allows.

What is the difference between a Copilot Studio topic and a plugin action?

A topic is a conversational flow you design — it defines how the agent responds to specific trigger phrases, collects inputs, and branches the dialogue. A plugin action is a callable function (such as a Power Automate flow or an OpenAPI endpoint) that the agent invokes mid-conversation to retrieve or process data. Topics orchestrate the conversation; plugin actions perform the actual work.

Can I embed the Copilot Studio agent in Microsoft Teams?

Yes. Copilot Studio provides a native Microsoft Teams channel. Once you publish your agent, go to Channels and select Teams — the integration requires no extra code. If your organisation needs help deploying Copilot Studio across Teams, Alphavima's Power Platform team can guide you through the full setup.

How many Dataverse tables can one agent query?

There is no hard limit on the number of tables an agent can query. You can create multiple topics, each connecting to a different table or view. For performance, use filtered queries and retrieve only the columns you need rather than fetching entire rows.

Will the Copilot Studio agent work offline?

No. Copilot Studio agents require an internet connection to communicate with the backend services. For offline Dynamics 365 scenarios, consider using the Dynamics 365 mobile app with offline sync instead.

How do I test my agent before deploying it to end users?

Use the Test your agent pane inside Copilot Studio. It provides a live chat window where you can simulate conversations, inspect variable values, and step through topic branches. For integration testing, use the Demo website channel to share a preview link with stakeholders before full deployment.

    Get in Touch