We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Apply formating using script on attachment

Rj27
Mega Guru

Hello,

I am generating an attachment of type excel using

GlideSysAttachment().write();
I want to add some formatting/formula to it.

Can we do it using script so that when user downloads the file, data is displayed based on the formatting ?

5 REPLIES 5

AylinTurhan
Giga Contributor

It sounds like you're looking to add some formatting or formulas to the Excel file you're generating using GlideSysAttachment().write(). While GlideScript itself doesn’t provide direct methods for adding Excel formulas or formatting, you can actually use an approach with Excel's built-in XML format (xlsx) to insert formulas or apply styles.