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 Automate / Apostrophe in variable...
Power Automate
Unanswered

Apostrophe in variable passed into SQL query generates error

(0) ShareShare
ReportReport
Posted on by 20

Have a SQL table that PAD is querying. Column A contains string values, in some of the rows apostrophes are used.

 

I am then using those data values to perform an additional query in a completely separate flow.

 

However I then get an error that indicates it has not been escaped properly:

 

chrisevans10_0-1699397796271.png

I have tried running the query with the variable in double quotes "%example%" and with the variable in single quotes '%example%'. I have also tried replacing the apostrophe with two, as has been suggested on PA (but not PAD) pages but to no avail.

 

Any suggestions?

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Could you please send me the query you have written?

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Based on the following article, you can escape a single quote character by replacing it with two single quote character (not a single double quotes character). You can do that by using Replace text on your variable and replacing ' with ''

    See the reference here: https://www.databasestar.com/sql-escape-single-quote/#:~:text=The%20simplest%20method%20to%20escape,Server%2C%20MySQL%2C%20and%20PostgreSQL.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss 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

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 664

#2
Haque Profile Picture

Haque 460

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard