The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Deepa Srivastav
Kilo Sage

Exports sets is introduced from Geneva and provide a great way to export reports to the MID server. Creating export set is quite simple and self explanatory. I will be focusing on some main points which are not mentioned otherwise. You can find related modules under System Export Sets.

find_real_file.png

By default the file is exported to the below folder in MID server.

/Servicenow/installed_mid_server_folder_name/agent/export/ plus the file path given in the export target. Example if you give /dropbox/myFiles/   in File path, then the file location would be:

E:/Servicenow/mid12/agent/export/dropbox/myFiles

find_real_file.png

For transferring this file from MID server to a SFTP location/dropbox, we need to use the post script option available in 'Scheduled Exports'. Though this can be done in number of ways (like configuring batch file with the help of windows task scheduler in MID server, loading a JAR file in ServiceNow and then have JavascriptProbe make Package calls into them etc). But then I found this one the most appropriate which utilizes the features provided by Service Now . The key here is the Javascript probe which must be used to call server side script on MID server. Javascript Probe is explained very nicely in this link: http://www.john-james-andersen.com/blog/service-now/javascriptprobe-and-mid-server-script-includes.h...

We have to write a script include in MID server and have it called from the post script using Javascript probe. This script can be called from other script includes, scheduled job etc.

find_real_file.png

find_real_file.png

Mid server script include code:

find_real_file.png

For debugging we use ms.log in MID server script include which can be checked from the MID server folder logs/agent0.log.0.

I didn't find any reference where SFTP file transfer in ServiceNow was explained from end to end so thought of sharing this. I have attached the code used for reference. Hope you find it helpful.

Please like/bookmark/comment/share (on the top right corner) if you liked the blog.

Reference links:

I am a creator - File Builder FTP - Jason Petty

23 Comments