1
votes

I have a requirement where i get mail address like jon'[email protected]. But while sending to salesforce i need to send like jon\'[email protected] .

This is the scenario where i need to use.

SELECT Email,Id FROM Contact WHERE Email = 'jon\'[email protected]'

Now the scenario is like below, but what happen here email address contain single quot where it is failed.

SELECT Email,Id FROM Contact WHERE Email = 'jon'[email protected]'

i have tried in different ways but they seems complected.

Please help

2

2 Answers

1
votes

You can use below expression in "Set Payload" to original string:

#[message.payloadAs(java.lang.String).replace("'","\\\'")]
1
votes

In order to concatenate you can use the ++ operator "Foo" ++ "bar" . Also take into account that in DW string can be represented by either " or ' . In your case I would say that you need to type 'jon\\'[email protected]' so that it will end up generating what you want. Regards