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 / We couldn't convert to...
Copilot Studio
Suggested Answer

We couldn't convert to Number.

(0) ShareShare
ReportReport
Posted on by
 
Hello I am new to Copilot.  What I am trying to do is update a field on a table.  My company is using BC on-premises.  I am a trying to update a Sales Order Line to the actual Item No that is being ordered.  I am able to get the agent to find the correct information but I am having a problem getting the agent to write back to the database.  I created a tool to do the update. 
 
I am getting the following error: Error Message: The connector 'SQL Server' returned an HTTP error with code 400. Inner Error: We couldn't convert to Number. Error Code: ConnectorRequestFailure Conversation Id: a771f51b-fb5b-4a32-bc08-6d8a6dfa2d57 Time (UTC): 2026-04-17T14:19:24.087Z  
 
The field I am trying to update is a string field.  I am not sure why I am getting this error.  Please help!
Categories:
I have the same question (0)
  • Vish WR Profile Picture
    777 on at
     
    This could be due to a datatype mismatch. Please check the datatime if required, convert first before writing it 
     
    Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 
  • Suggested answer
    Sajeda_Sultana Profile Picture
    66 on at

    The error is most likely coming from the Row id / key, not from the No_ field being text.

    Your table seems to use a composite key (including Line No_, which is numeric). If the Row id is built from column names or from text values that don’t match the numeric type, the SQL connector throws “We couldn't convert to Number.”
     
    Try this:
    • Ensure Row id is built from the actual key values (Document No_, Line No_, etc.), not from a pattern like [Document No_],[Line No_],[No_].
    • Verify Line No_ is passed as a real number (no extra spaces or formatting).
    • If No_ is part of the primary key, use the other key fields to find the row and avoid updating the key column itself if possible.
    If you can share the table’s primary key definition and a screenshot of how Row id is set, we can be more specific.
     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Sajeda_Sultana
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at
    ,Hello 

    The "couldn't convert to Number" error is related to the row identifier, not your string field. The SQL connector expects a numeric value (such as Line No. or Document Type), but it's receiving a string value (like Document No.).

    How to resolve:

    1. Make sure Document Type and Line No. are provided as integers (for example, use 1 for Order instead of "Order") and cast them with int() if necessary.
    2. Recommended approach: Use a stored procedure with clearly defined parameter types to avoid type-mapping issues with the connector.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 607

#2
chiaraalina Profile Picture

chiaraalina 143 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 129

Last 30 days Overall leaderboard