Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Get Email Attachment Name in Inbound Action

Tomoaki Tagawa1
Tera Contributor

Hi all,

I would like to get attachment file name in my inbound action which makes incident.

Is it possible?

* I think this is impossible... because inbound action is unable to get email attachment file name,

and even if sys_attachment can be queried, there isn't no attachment because at that time inbound action haven't made incident yet.

 

ANY help is welcome.

 

Best regards,

Tomoaki

1 ACCEPTED SOLUTION

Kushagra Mehrot
Kilo Guru

Hi,

 

Try this!

{slight change in uday's script}

var attachmentName = '';
var test = sys_email.sys_id;
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name','sys_email');
gr.addQuery('table_sys_id',test);
gr.query();

if(gr.next()){
attachmentName = gr.file_name;
}

 

Thanks
Kush

 

 

Please mark the answer correct/helpful accordingly!

 

 

View solution in original post

6 REPLIES 6

Tomoaki Tagawa1
Tera Contributor

Thank you! I could make it done!

 

Best regards,

Tomoaki

Hi Could you please let me know how you achieved the development?