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.

Script to export data in csv

koley
Kilo Explorer

Hi All,

I want to generate a report.

below is the requirement:

1) Query multiple tables.

2) Format the data using script.

3) Export

I want to export this in csv.

Is it possible?

I am using Schedule job. I am able to get and format the data. But how to export in csv ?

Thanks,

MK

7 REPLIES 7

Hi,

Have you done this work? If you have done so please share the code because I have the same requirement "I need to export some asset data (alm_hardware) in CSV format within the workflow and attach the CSV files in the email."  like you.

Please accept my solution if it works for and thumps up.

Thank for snippet code . Its been really helpful for one of requirement which required scripting attachment to email based on some logic


I am trying to do this same thing - it's almost working but I'm unable to get the sys_id of the sys_email record created to add the attachment to.  Not sure what I'm missing.  Super close but I need the sys_id of the email record.

If anyone has any ideas, I would appreciate.