email.body_text is not working in my Inbound email Action.

Community Alums
Not applicable

email.body_text is not working in my Inbound email Action. As soon as controller is reaching to execute this line of code it isn't proceeding further.

And, I have used below links for references. Where it is clearly mentioned to use email.body_text to access body of an email.

https://developer.servicenow.com/dev.do#!/learn/learning-plans/utah/new_to_servicenow/app_store_lear...

https://docs.servicenow.com/bundle/utah-platform-administration/page/administer/notification/referen...

5 REPLIES 5

Dhananjay Pawar
Kilo Sage

Hi,

Could you please share your code.

Thanks.

Community Alums
Not applicable

Hello, @Dhananjay Pawar, here's my Script. This is an Inbound Email Action.

(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {

gs.info("Email Body " + email.body_text);

})(current, event, email, logger, classifier);

 

Hi,

instead gs.info use gs.log("Email Body " + email.body_text);

then check the system log there you will get the details.

Thanks.

Community Alums
Not applicable

Yes, @Dhananjay Pawar I have figured out the solution. Thanks for the help.

So, was using email.body_text in Custom Scope. Now, after trying out in Global scope it worked.