cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
therealalex
New Member

Unable to Patch date field to an Azure SQL Database

Hello fellow app builders.

 

I've been scratching my head with this one all day long. I have found some post online with similar error messagescoming back from SQL Server, but nothing that has helped my solve my problem.

 

I am creating a Canvas app that will collect some data for the user, and create a new row of data in a SQL table via the Patch function.

 

When I initiate the patch, I receive the following error message, "The requested operation is invalid. Server Response: MySQLTable failed. Conversion failed when converting date and/or time from character string clientRequestID xxxxx-x-xxxxx-x"

 

Here is my Patch code:

 

Patch(
  MySQLTable,
  Defaults(MySQLTable),
  {
    AccountGUID: WonOpportunity.parentaccountid.accountid,
    OpportunityGUID: WonOpportunity.opportunityid,
    OpportunityOwnerEmail: WonOpportunity.owninguser.emailaddress,
    ModifiedDate: Now()
  }
)

 

My Modified date is defined as follows in my table:

       [ModifiedDate] [datetime] NOT NULL,

 

 

I have tried to format my "Now()" datetime in every way imaginable to work around this error without any luck. I have refreshed, deleted, and reconnected my SQL connector.

 

I have other apps running that use a similar Patch function to write to a SQL table without any issue. I'm hoping there is something obvious that I'm just missing and can't see.

 

Thanks in advance for any advise!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@therealalex 

Take a look in the Monitor Tool and see what *exactly* is being sent to the connector and see if there is a clue there.  That will give you the best answers.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@therealalex 

Take a look in the Monitor Tool and see what *exactly* is being sent to the connector and see if there is a clue there.  That will give you the best answers.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

therealalex
New Member

Thanks, Randy! I didn't even know that tool existed... It provided the detail I needed to get to the bottom of this issue.

 

-Alex

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,943)