When including single quotes in bot responses, always prefix them with a backslash \ character to prevent unexpected behavior. For example: lu\’au instead of lu’au.

Pipe | and ampersand & characters have special meaning in code blocks as well and may need to be prefixed with a backslash.

When including single quotes in bot responses, prefix them with a backslash (\) to prevent errors inside expressions.

For this example, we are writing a conditional statement in the property editor that checks whether user.testValue is set to lu’au. If it is, it returns the phrase “This returns True!” and if not, it returns “This returns False!”:

specialCharacterWrong.png

Since lu’au is within an expression that already includes single quotes, the apostrophe in lu’au will prematurely end the expression, causing a syntax error.

To resolve this issue when using single quotes inside an expression, you can either use double quotes as such: “lu’au” or add a backslash before the single quote to escape it: ‘lu\\’au’

Example using escaped single quote:

${if([user.](<http://user.name/>)testValue == 'lu\\'au', 'This returns True!', 'This returns False!')} 

Using Double Quotes:

Alternatively, you can use double quotes to avoid the need for escaping:

${if([user.](<http://user.name/>)testValue == "lu'au", "This returns True!", "This returns False!")} 

<aside> 💡

Special characters like & and | typically don't need escaping in most contexts. However, if you encounter unexpected behavior, try wrapping the value in quotes or prefixing the character with a backslash (\\) to ensure it’s treated literally.

</aside>