The CreatorCon Call for Content is officially open! Get started here.

Debugging Script in Flow Designer

Ziad Qadora
Kilo Sage

Hello,

I have a requirement to create a case from an inbound email action.  I have  used Flow Designer to create the inbound action, and that is working fine. 

I'm trying to clean the email body and remove extra un-related text before populating the case description. 

The code below is what I'm using, and the description is empty when the case is created. 

I have added gs.debug statements to try debug the logic.  But I cannot find these debug statements in System Log.  

Please let me know if I'm looking in the right place for debug statement created by the Flow Designer. 

If you see any issues with the replace logic, then please let me know.

var email_body = fd_data.trigger.inbound_email.body_text;
gs.debug("Description1: " + email_body);
email_body = email_body.replace(/^EXTERNAL EMAIL.*$/g,'');
gs.debug("Description2: " + email_body);
email_body = email_body.replace(/^This message may contain.*$/g,'');
gs.debug("Description3: " + email_body);
return email_body;
 
Regards,
 
Ziad
 
find_real_file.png
5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi @Ziad Qadora ,

please use JS method replaceAll().

It seems, that your regular expressions don't work .

For example:

 email_body = email_body.replaceAll("EXTERNAL EMAIL",''))

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Ziad Qadora
Kilo Sage

Hi @Maik Skoddow ,

 

Thank you for the response this will only remove the words "External Email" from the text and not replace/delete the whole line which is what  I'm trying to do. 

Also, I still need to figure out where to find the logging of the debug statements for Flow Debugger is stored.

Regards,

 

Ziad

 

 

 

 

Ziad Qadora
Kilo Sage

Hi,

To replace the full line the below has worked

email_body = email_body.replace(/EXTERNAL EMAIL\:[\w\W]+?\n+?/, "");

I'm still trying to find out where do the debug statements  in Flow Designer scripts get logged.

Regards,

Ziad

Hi @Ziad Qadora ,

in Flow Designer go to tab "Executions"

find_real_file.png

Open a single item. In the following dialog you have different options to make output, log statements and variable values visible:

find_real_file.png

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.