• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Login
  • Automation Institute
  • Documentation
  • Community Forums
New Topic
Discussions Recipe Building Formula Mode Questions
S

Saul Macht

started a topic almost 6 years ago
Answered

Escape single quote

I am trying to search customers by name but some customer names contain single quote e.g. Saul's and this throws an error. How can I escape the single quote to resolve the error and search for the customer record?


Best Answer
A
Amanda Wong said almost 6 years ago

Hi Saul, you can use gsub to help you escape single quotes. Any of these should work:


  

"Saul's".gsub("'", {"'"=>"\\'"})

   

   

"Saul's".gsub("'","\\\\'")

   

Answer

Amanda Wong

said almost 6 years ago

Hi Saul, you can use gsub to help you escape single quotes. Any of these should work:


  

"Saul's".gsub("'", {"'"=>"\\'"})

   

   

"Saul's".gsub("'","\\\\'")

   

Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2022   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count