Change name of the file in export set

ark6
Mega Guru

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

18 REPLIES 18

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Arka,



There is no way you can modify I think because it is internal to ServiceNow and the code may not be exposed. Even if you try to modify it may break in future upgrades.


One solution you can use is modify the file name in mid server script Include.



Approach:


1) let the mid server export the file


2) In scheduled export set send a probe to mid server and send this updated file name as parameter


3) get this parameter in mid server script include and using mid server script include update the file name


a) Use java code to search last modified file in the directory


b) then using java code modify the file name as per the parameter you sent to mid server via ecc_queue.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,



Thanks for the suggestion.



However, I am not sure how to write the include to rename the file.



Regards,


Ark


Hi Arka,



you would require some expertise in java as well to write the mid server script include since it requires knowledge of java classes and packages. Although this is achievable I would recommend not to go with the requirement. You can always mention to customers/clients that this is out of box functionality which ServiceNow provides and they haven't exposed the script and hence this is not feasible to rename the file.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ya, I understand. Trying to do some reverse engineering.



To change the file name through a scheduled job in the export set before it runs the schedule export..