Build a Copilot Studio agent that answers from Dataverse
Create an agent in Copilot Studio that answers questions from your Dataverse tables, add a topic that takes action, and publish it to Teams.
What you'll learn
- Create an agent and write instructions that keep it on task
- Add Dataverse tables as a knowledge source
- Add a topic that calls a flow to take action
- Test, then publish the agent to Microsoft Teams
On this page
Agents are the fastest way to put AI in front of your users without building a new app. In this guide we build a support agent that answers questions about open cases straight from Dataverse, and can escalate a case when asked.
How an agent is put together
Before clicking anything, it helps to know the four building blocks:
| Block | What it does | In our example |
|---|---|---|
| Instructions | Tell the model how to behave | "Answer only about support cases" |
| Knowledge | Data the agent can search | The Case table in Dataverse |
| Topics | Guided conversations you design | "Escalate a case" |
| Actions | Things the agent can do | A flow that updates the case |
Create the agent
- Open Copilot Studio and pick the environment that holds your data.
- Create a new agent and give it a clear name, such as Support Assistant.
- Write instructions. Be specific — vague instructions are the most common reason agents wander off topic.
You help support staff with customer cases.
- Answer only questions about cases, customers and SLAs.
- Always include the case number (for example CAS-1042) when you mention a case.
- If you are not sure, say so and suggest checking the case record.
- Never invent case numbers or dates.Add Dataverse as knowledge
In the agent's Knowledge section, add Dataverse as a source and select the tables the agent may use — here, Case and Account.
Security still applies: the agent only returns rows the signed-in user is allowed to see. That is one of the big advantages of grounding on Dataverse instead of exporting data somewhere else.
Add a topic that takes action
Answers are useful; actions are what make an agent valuable. Create a topic called Escalate a case:
- Add trigger phrases such as "escalate case" and "raise priority".
- Add a question node that asks for the case number and saves it to a variable.
- Add an action that calls a Power Automate flow. The flow takes the case number, sets Priority to High, and returns a short message.
- Finish with a message node: "Done — {case number} is now high priority."
The flow itself is small:
{
"trigger": "When an agent calls a flow",
"inputs": { "caseNumber": "string" },
"steps": [
"List rows: Cases where ticketnumber eq caseNumber",
"Update a row: prioritycode = High",
"Respond to the agent: 'Escalated'"
]
}Test and publish
Use the test pane while you build. Try questions you expect, and questions you don't — such as asking about the weather — to confirm your instructions keep the agent focused.
When you are happy, publish the agent and add the Microsoft Teams channel. Users can then chat with it where they already work.
What to do next
- Add more knowledge, like a SharePoint site with your support procedures.
- Review the agent's analytics to see which questions it can't answer yet.
- Turn frequent unanswered questions into new topics.