Attach excel file to email notification

G Balaji
Kilo Guru

Hi,

I've a record which has an excel file attached to it. I wanted to send this excel file as an attachment over email notification to a list of recipients. 

I'm using following script and attached events and notificaiton but notification is sent without attachment.

Pls find screenshots of my notification, script for firing the event which will trigger notification, 

var gr= new GlideRecord('u_account_info');
gr.addQuery('sys_id','0e16fb4cdb396b805eb551b0cf961968');
gr.query();
if(gr.next()){
gs.eventQueue('ControlListNotif',current,'31346f00db6c23885eb551b0cf96197a');
gs.info('Event fired');
}

1 ACCEPTED SOLUTION

Arindam Ghosh
Mega Guru

Hello Balaji,

This thread will be helpful:

https://community.servicenow.com/community?id=community_question&sys_id=1b417e9bdb475348200f0b55ca961901

 

Thanks,

Arindam

View solution in original post

4 REPLIES 4

Joel Millwood2
Kilo Guru

Hi G Balaji,

There is an out of the box Email Script - attach_links that you can add to your email notification that will achieve this for you. System Notification > Email > Notification Email Scripts > attach_links which can be added to your email notification by adding : ${mail_script:attach_links}.

Arindam Ghosh
Mega Guru

Hello Balaji,

This thread will be helpful:

https://community.servicenow.com/community?id=community_question&sys_id=1b417e9bdb475348200f0b55ca961901

 

Thanks,

Arindam

ARG645
Tera Guru

Balaji,

 

Are you using this script in a Business Rule ? 

does "current" represent the Glide Record object of u_account_info table? 

 

If so, the record representing "current" should have an attachment. 

-Aman Gurram

kalyan778
Mega Guru

Hi Balaji,

Please follow the below steps and check

1.Create a new notification on the respective u_account_info custom table.

2.Select the appropriate trigger condition.

3.Set the View as advanced view and goto to What it will contain section/

4.In this section you have Include attachments checkbox.

Please set it to true and save it.Now when ever any notification triggered it will attach the attachment what ever it is there on record.

 

 

find_real_file.png