Formatting of email in an inbound email action

Alex Saager1
Tera Contributor

I'm trying to format an inbound email action to make the description more readable.

 

what I'm trying to do is change the format from the 1st screenshot of how the email comes in

AlexSaager1_0-1684230395831.png

but want to add a return to look more like the second below by adding a return and wondering the best way to approach this.

 

requestedUserEmail: a.saager@wellcome.org 
requestedUserName: Alex Saager
reason: /

 

 

Kind regards

Alex

1 ACCEPTED SOLUTION

Amit Gujarathi
Giga Sage
Giga Sage

HI @Alex Saager1 ,
I trust you are doing great.
To make it more readable you can firstly split it with the spaces it will give the array of 6 elements .
Then you can join 2 and go on, please find below code snippet which I have tried.

var a = "requestedUSerEmail: ami@gmail.com requestedUserNAme: amit requestedUSerId: AMIT123";

var aArray = a.split(' ');


var finalString = aArray[0] +" "+ aArray[1] +"\n"+
                  aArray[2] +" "+ aArray[3] +"\n"+
                  aArray[4] +" "+ aArray[5] +"\n";

gs.info(finalString);

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



View solution in original post

2 REPLIES 2

Amit Gujarathi
Giga Sage
Giga Sage

HI @Alex Saager1 ,
I trust you are doing great.
To make it more readable you can firstly split it with the spaces it will give the array of 6 elements .
Then you can join 2 and go on, please find below code snippet which I have tried.

var a = "requestedUSerEmail: ami@gmail.com requestedUserNAme: amit requestedUSerId: AMIT123";

var aArray = a.split(' ');


var finalString = aArray[0] +" "+ aArray[1] +"\n"+
                  aArray[2] +" "+ aArray[3] +"\n"+
                  aArray[4] +" "+ aArray[5] +"\n";

gs.info(finalString);

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Hi @Amit 

 

Thank you for this, works perfectly.

Alex