Export to Excel using a background script

Suresh1
Tera Guru

Hi Team,

 

Using background script can we generate an excel file with the custom columns?. I am wondering how to achieve this.

Basically I need to glide SNOW table and from that table i need to get the columns and generate a custom excel and put the data over there.

 

Let me know how to achieve this.

 

Thanks,
Suresh

1 ACCEPTED SOLUTION
3 REPLIES 3

Alikutty A
Tera Sage

Hello,

You can achieve this with the RestMessageV2 function saveResponseBodyAsAttachment(). Basically you need to make a Rest call on the SN table view that has the required columns using the EXCEL URL processor and it would extract the required data and attach it on a specific record passed to the function.

https://docs.servicenow.com/bundle/london-application-development/page/app-store/dev_portal/API_reference/RESTMessageV2/concept/c_RESTMessageV2API.html

Jyothy S
Giga Contributor

Hi, 

Need to generate an excel automatically from an HTML Table content created by processing data in certain table via scheduled job. The HTML table content has text differences between columns highlighted in different color. Need the excel file to contain these formatting.Once the file is created it should be sent via email. Any thoughts on how to achieve this

TEST.png