
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:08 AM
Hi experts,
I'm trying to remove the apostrophe from an inbound action email body. I've tried various script which have a variation of;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:56 AM - edited 09-27-2023 04:58 AM
Thanks for the input, try the one below.
var messageBody = email.body_text;
messageBody = messageBody.replaceAll("'", '"').replaceAll("#39;", '"');
Please mark my answer helpful and accept as solution if it helped you 👍✔️
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:28 AM
I tried this in Background script, it was working 😀 Keep exploring.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:25 AM
Which encoding it is? Can you provide a sample line of it's original text and encoded one?
Anvesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:34 AM
Hi - thank you so much for your reply.
So the text looks like this when it's in the incident description. I've removed the actual text in some cases and replaced it with 'xxxxxxx' . I literally just need to remove either the apostrophe or the apostrophe symbol (')
The Integration Task 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx#39;Second xxxxxxx - Bank ' failed at 'Tuesday, 26 September 2023 10:45:10 BST'. For more details about the failure please review the log files available in the execution history within the Integration tasks page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:56 AM - edited 09-27-2023 04:58 AM
Thanks for the input, try the one below.
var messageBody = email.body_text;
messageBody = messageBody.replaceAll("'", '"').replaceAll("#39;", '"');
Please mark my answer helpful and accept as solution if it helped you 👍✔️
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:34 AM
Hello,
Is '' a particular string?
If it is one string then try the below:-
var body = email.body_text;
var expectedTxt= body.split("'") ; // add your line here or keep 4 words
var finaltext= expectedTxt[0]+' '+ expectedTxt[1]
gs.log("finaltext: "+finaltext);
Please mark my answer as correct based on Impact.