Change name of the file in export set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 10:03 AM
Hi,
I am using export set and want to change the name of the file to be exported to mid server before exporting.
My requirement is to attach the current date to the file name, but when I do an append timestamp it appends both date and time on the file name.
Is there a way we can control this behavior and try to attach the date instead of a whole timestamp?
Regards,
Ark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 08:33 AM
Hi Ankur,
Thanks for reaching out. I already marked your reply as helpful
Regards,
Ark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 11:02 AM
Hi Ankur,
Thank you for sharing such valuable information, It is always intriguing to find out new capabilities in Service-Now Love It !!!
I have tried the Business rule on the sys_attachment table but it is throwing an error "No sensors defined". Should i also write a sensor code?
Please Advice.
pK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2022 04:07 AM
Hi
The pre-script is not updating the file name in Export Set before the export starts.
Now what is the solution ? How Can i fix this issue ? kindly help me.
Pre-script :
var Date = new GlideDate();
var todayDate = Date.getByFormat('yyyyMMdd');
var exportsetId = gs.getProperty('exportserID'); //ExportSet sysID
var filename = gs.getProperty('filename'); // FileName
var exportset = new GlideRecord('sys_export_set');
if(exportset.get(exportsetId ))
{
var modifiedName = filename+'_'+todayDate+.'csv';
exportset.file_name = modifiedName ;
exportset.update();
}
Post-script:
var prob =SncProbe.get("windows - Powershell");
prob.setName("windows - Powershell");
..
..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2022 04:26 AM
Hi,
are you sure the query ran fine?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 02:14 AM
Hi Arka, I have same requirements.
What I did is :
- Leave Append timestamp unchecked
- Allow user to add yyyyMMdd, ddMMyyyy, yyMMdd, ddMMyy, dd-MM-yyyy, yyyy-MM-dd to the Name of the Export Definition
- Change Dictionnary of File Name in Export Set record to a calculated value. Within a Script include, I replace the found regular expression by today's date on expected format.
One problem is still remaining: This way of doing only updates the file name whenever I open the export set record before the export is done. I am trying to figure out why is it behaving like this (it seems that calculated field is not recalculated when read is done on server side).
