web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Execute stored procedu...
Copilot Studio
Suggested Answer

Execute stored procedure - Agent input String value to Parameters list instead of Record

(0) ShareShare
ReportReport
Posted on by
Hi everyone,
 
I created a Copilot Studio agent, connected to my SQL Server, added an excel file - all Stored procedures' definition as Knowledge Source (so that the agent can detect which one to use and how to use), added a tool "Execute stored procedure (V2) with below details:
  • Maker-provided creds
  • Server name = Use connection string
  • DB name = Use connection string
  • Procedure name = Dynamically fill with AI
  • Parameters list (Disabled - Dynamically fill with AI)
 
The flow is: agent receives user's query -> check Knowledge source to detect which stored procedure to call and how to use it (params/args to specify) -> call the tool (=execute the stored procedure) -> generate the response.
 
Last month or early this month (Jun 2026), the agent itself was able to pass input value for Parameters list as Record value, and executed the stored procedure successfully. However, at the moment, the agent inputs Parameters list as a String value and leads to this error:
Error Message: Evaluating PowerFx expression resulted in error while invoking the connector : Expected to get object for property parameters but got StringValue Error Code: ConnectorPowerFxError
Just wonder if there're any changes around this and solution? Can we somehow let the agent behave like before? Any DLP policies can cause this behavior (but I do not have permission to view and/or edit)?
 
Besides, I have some ideas if cannot tweak the agent to get back to previous behavior:
1. Create Power Automate flow to process Stored procedure execution task, parse for inputs (transform if needed), then execute the stored procedure.
2. Create a topic for Executing stored procedure, parse user's query and transform for input, then call tool to execute the stored procedure.
3. For every stored procedure x params set, add a dedicated Execute stored procedure tool & rename it accordingly (e.g., get records by name, get records by department, get records by name and department, etc). However, the number of tools will grow by time, with some duplicates and performance issue when the agent needs to handle too many tools in the future.
 
Anyone faces same/similar issue, or has feedback and thoughts on this?
SQL_ExecuteStoredProcedure_AFTER.png
SQL_ExecuteStoredProcedure_BEFORE.png
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,211 Moderator on at

    I’ve seen similar behavior recently. From your screenshots, the issue is that the agent is now passing parameters as a string instead of a record, which causes the SQL connector to fail.

    You can clearly see the difference:
    Earlier (working):
    parameters (Record)
    {
      "param1": "value"
    }
     
    Now (failing):
    parameters (String)
    "{\"param1\":\"value\"}"
     
    So the JSON is being sent as text, not as an object, which leads to:
    --> Expected to get object for property parameters but got StringValue
     
    This looks like a recent change in how Copilot Studio maps dynamic inputs to connectors, not a DLP issue.
    For now, the most reliable workaround is to wrap the stored procedure call in a Power Automate flow, parse the input there, and then call SQL with a proper record.

    Direct dynamic mapping from the agent is currently not consistent.
     
    ✅ If one of the responses here solved your issue, please mark it as Accepted so others facing the same problem can benefit as well.
    👍 If this or any other reply here helped you, feel free to give it a Like. It helps others and is always appreciated.

    Sunil Kumar Pashikanti, Moderator
    Blog: https://sunilpashikanti.com/posts/
  • Suggested answer
    11manish Profile Picture
    3,052 on at
    Based on the timing ("worked last month, fails now"), the most likely explanation is that a recent Copilot Studio or connector update changed how AI-generated
     
    tool arguments are serialized. The Parameters list property now appears to require an explicit record/object, while the agent is generating a string value, resulting
     
    in the ConnectorPowerFxError.

    Use a Power Automate flow as an intermediary layer. Let the agent collect the required inputs, pass them to the flow as simple parameters, and have the flow
     
    execute the stored procedure. This is currently the most robust, scalable, and supportable pattern for SQL stored procedure execution from Copilot Studio.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 302

#2
11manish Profile Picture

11manish 146

#3
chiaraalina Profile Picture

chiaraalina 118 Super User 2026 Season 1

Last 30 days Overall leaderboard