How to remove instance email address in Recipients field.

Sai Pavan1
Tera Contributor

Hi Community,

I have a requirement where - 'If system receives an email through inbound email action then the instance email id is stored in the Recipients (String field) field by default.

How to remove the instance email id from Recipients field. What script needs to be used ?

 

find_real_file.png

In the above screenshot, Out of 4 email addresses we need to remove the first one which is the Instance email address. How can we remove that particular email address for all the inbound emails that system will receive ?

1 ACCEPTED SOLUTION

Vasantharajan N
Giga Sage
Giga Sage

Is there any business requirement? if yes then you can use below logic as an example

You can write before insert business rule on sys_email table where you can trim the instance email id from recipients table

var curr = current.recipients;

current.recipients = curr.replace(curr,"instanceemail","");


Thanks & Regards,
Vasanth

View solution in original post

6 REPLIES 6

var curr = current.recipients;

current.recipients = curr.replace("instanceemail","");

The above script works fine for removing or trim the instance email id from field.

Hi @Sai Pavan - Could you please mark my answer correct instead of your response. 


Thanks & Regards,
Vasanth