Hey , i am trying to build a flow that will extract dataa from emails and put into HubSpot.
I get to the point where i need to put the whole email body(html) into hubspot.
Been working for hours to find a way to replace the characters so it gets a propper json file.
i'm trying to make a js to replace unwanted characters ex: new line with \n, etc .
----------
var text=`%IndividualMail.Body%`;
text = text.replace(/\\/g, '\\\\');
text = text.replace(/\t/g, '\\t');
text = text.replace(/\n/g, '\\n');
text = text.replace(/'/g, "\\'");
text = text.replace(/"/g, '\\"');
WScript.Echo(text);
------------
The issue is that at runtime, i get :
C:\Users\cd\AppData\Local\Temp\Robin\r5qxrvkdmy1.tmp(1, 10) Microsoft JScript compilation error: Invalid character.
Of ocurse the body_email looks something like :
</style>
==============
But it shoud turn into something like:

Report
All responses (
Answers (