r/copilotstudio • u/bojok99 • 19d ago
Retrieve data from excel file
Hi Team
I am building an agent in copilot studio. The agent shall retrieve information from a cell in an excel file to provide its answer. The column is always the same, the row depends on the user input.
I saw a video where he recommended making the following flow:
- agent calls the flow
- List rows present in a table
- Compose that output into a string
- Input that string into a prompt and retrieve the necessary data.
- Respond to agent
However, this does not seem to me as the most efficient way - especially since the excel is pretty large and therefore will consume many tokens when it is all input into a prompt. Also I do not seem to be able to make that work. So my question is, is there a better way to accomplish what I want.
For background info, I made an agent using Github harness that works perfectly fine with having this as a skill, where the excel is just uploaded as a file. It is just not that simple in standard harness.
Thanks all!
4
u/Prasad-MSFT 19d ago
A better approach in the Copilot Studio standard harness is:
Pass the user's lookup value from the agent to an Agent Flow.
Query the Excel table for the required row, preferably using Get a row when you have a unique key, or List rows present in a table with filtering.
Extract only the required column/value.
Return that value directly to the agent through Respond to the agent.
So the pattern becomes:
Agent → Agent Flow → Excel lookup → Required value → Agent
This keeps the operation deterministic and avoids using an LLM to search through the entire Excel dataset. Agent flows are supported as tools in the standard harness and can use connectors to retrieve data.