-
Uses a Fabric Data Agent to generate NL2SQL queries from natural-language questions.
-
Returns a preview table with sample rows.
-
Displays the exact SQL query that can be used to retrieve the full result set.
-
After showing the preview, the agent asks the user if they want to download the full data to OneDrive.
-
If the user answers "yes", a custom tool is triggered that:
-
Receives the agent’s last message (
System.LastMessage.Text), -
Parses and extracts the SQL query from that message,
-
Executes the query against Fabric, and
-
Saves the full result set as a CSV file in the user’s OneDrive.
-
Error code: SystemError. Conversation ID: <guid>. Time (UTC): <timestamp>- The flow is listed as a tool and is enabled (condition set to "Agent may use this tool at any time")
- The flow plan is "Copilot Studio" and status is "Activated".
- My agent is running in Copilot Studio using the same tenant/account that owns the flow and OneDrive
- I can manually run the exact same SQL on the Fabric endpoint and it returns rows (so it's not an empty result causing issues).
If it helps, I can share screenshots of the flow design and configuration. Any guidance or examples of a similar setup would be very helpful.

Report
All responses (
Answers (