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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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

3 REPLIES 3
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
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

what was the issue?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,251)