cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbrit2020
Responsive Resident
Responsive Resident

Powerapps triggering Syntax error on SQL Connector

This used to work well up until this morning, I've been using this app since July last year.

 

Today when patching a value to the SQL database on an already existing record, I got a syntax error:

 

jbrit2020_0-1614782009023.png

 

It's due to the following symbol on the title of the already existing record: '

 

The title has been there with this same symbol for ages and it's never given me problems.

 

There has been no changes to the SQL DB or to the APP itself.

 

Any idea what could be wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
jbrit2020
Responsive Resident
Responsive Resident

@RandyHayes so, the issue seems to be that the primary key on the database is the title that contains the apostrophe. I created an incrementing Integer primary key on the SQL DB and now that it only looks at a number to patch the values it works great.

 

Odd that I've either noticed that before or it has never triggered an error. All sorted though.

View solution in original post

5 REPLIES 5
jbrit2020
Responsive Resident
Responsive Resident

@RandyHayes Sorry for luring you in. Shouldn't the premium SQL connector API handle this automatically?

RandyHayes
Super User III
Super User III

@jbrit2020 

There is a possibility that there was always an error with it and it was never accounted for...and perhaps there has been a change in the connector and now it does.

That is pure speculation though. 

 

Has anything else possibly changed in your database or app?  

 

The next step I would take would be to bring up the monitor tool and look at that exact transaction to see exactly what it is sending to the connector.  That would probably yield the best results.

 

 

_____________________________________________________________________________________
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
jbrit2020
Responsive Resident
Responsive Resident

Just tried that for the first time, pretty useful, it is indeed the apostrophe that is causing all the mayhem.

 

On the URL encoding part the apostrophe is translating to %2527 instead of  %27. I do not know though if this still happened before today but I know the URL encoding for an apostrophe is %27.

 

No idea where to go from here though....we can't edit the connector

jbrit2020
Responsive Resident
Responsive Resident

@RandyHayes so, the issue seems to be that the primary key on the database is the title that contains the apostrophe. I created an incrementing Integer primary key on the SQL DB and now that it only looks at a number to patch the values it works great.

 

Odd that I've either noticed that before or it has never triggered an error. All sorted though.

View solution in original post

RandyHayes
Super User III
Super User III

@jbrit2020 

Yay!!!  That is good you got past that.  There are actually a few bugs that I have found in the connectors.  My favorite is with the SharePoint connector (possible even happens in the SQL connector, but I've never confirmed) where you pass a TEXT...yes, pure text only, value to be stored in a pure text column in SharePoint and that Text happens to have a text representation of a UTC base date...it will reformat it.  Go figure!!  It has been recognized by Microsoft as a bug, but I am not holding my breath for it to ever be fixed.

_____________________________________________________________________________________
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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (88,245)