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 / Power Apps / Patching to SQL: data ...
Power Apps
Unanswered

Patching to SQL: data types wont match up

(0) ShareShare
ReportReport
Posted on by 42

Hi all, 

 

Hope all's well. I'm working on a power app at the moment where I'm patching some data from and to a SQL table, the problem I'm having is that the patch throws back an error saying that the data type is wrong.

 

I've tried changing the data type directly within the patch by using Value() and DateValue(), but that didn't seem to work. I also tried changing the datatype and associating it with local local variables, which I then used in the patch, but that didn't seem to work either.    

 

Ie. Patch(Source, {Date: DateValue(SourceDate), Number: Value(SourceValue)})

 

Any idea's as to what might be wrong? 

 

All the best!

Rhys. 

Categories:
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    SQL has a number of Date and Number data types.  What specific data type is the field in SQL.  Not all of them are compatible with Power Apps.  Also, normally you need a second parameter on the Patch to specifically identify the SQL record you are updating.

  • RhysD Profile Picture
    42 on at

    Thanks, that gave me a much better lead. I've managed to get past the original error now by double checking the record that was put in, however I now have another error.

    The table it's going into requires a text field filled out that isn't within the form, it's effectively a default value that's needed for each entry, I've tried to supply the value directly but it's still saying that it requires data. Any ideas? It doesn't specify that the data type is wrong, just that it can't see it.  
    (formatting below).

    RhysD_0-1621592622603.png

  • mogulman Profile Picture
    764 on at

    Is this Azure SQL?  It is correctly formatted.  I have a similar field.

     

    ErrorMessage: "",

     

    Defined by

    [ErrorMessage] [varchar](256) DEFAULT('') NULL,

     

    I would create an INSERT statement that duplicates the Patch and run it from SSMS.  It is possible you are not fully defining the data required to insert data.

     

    If this is on-premise SQL Server run SQL Profiler and see what is going on.

  • RhysD Profile Picture
    42 on at

    weirdly enough, when I add in the AuditSource twice is throws back an error saying it's already been defined:

    RhysD_0-1621598801066.png

    My colleague thinks it's a formatting error, but we're both a bit stumped with it.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard