How to download csv file using Script without using URL ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 03:00 AM
We would like to create a Ui Action on the Database View list screen so that a Csv file can be downloaded when the button is pressed.
When the UI Action button is pressed, the Script Include will be called, and the file can be downloaded according to the code in the Script field of the Script Include.
I was thinking of using the code in the following image as a reference, but the code in this image attaches the file to the record at the end.
I did not attach the file, but downloaded it as is.
If possible, I would like to use this code as it is and replace the attached part with a direct download code.
Any help you can give me would be greatly appreciated.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 03:19 AM
Hi,
Are the users not able to directly export using the OOB Export CSV?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2022 06:30 PM
Dear Ankur
The premise is that I would like to output the Header of the CSV file with the label name while leaving the column name as the output setting for the csv header in the Export Import module settings.
To meet this requirement, we would like to set the Header when outputting the CSV on the Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2022 08:36 PM
it's custom solution and might involve complex logic.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 07:44 PM
Dear Ankur
Thank you for your reply.
If you have an example of a custom solution, we would appreciate it if you could provide us with a sample code example.
Best regards