Escaping apostrophes within a search

Hello.
I’ve built a senario to take form responses and upload them in to Salesforce as a new account with contact etc.
However, to save duplicates, part of the first stage of the scenario is to check if there is already an account with the same name.
I’ve setup a SOQL search where we check for the company name within our Salesforce Org, however if we try to upload an account with an apostrophe within it’s name we get the error

[400]
name = ‘Company Name Pro’s’ LIMIT 10
^
ERROR at Row:1:Column:70
line 1:70 mismatched character ‘’ expecting ‘’’

Does anyone know of a way aroudn this?


Include screenshots of

  • your scenario setup (functions, mappings, variables, etc.)
  • module configurations and outputs
  • any error messages you are getting

Welcome to the Make community!

According to ruby - What characters do I need to escape when doing a SOQL query? - Salesforce Stack Exchange and Salesforce Developers

You can escape the quotes by using a \ character before it.

This can be done using the built-in function replace

e.g.:

{{ replace(text; "'"; "\'") }}

For more information, see the function documentation in the Help Center.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like