Set up FTP Data Source
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 07:48 PM
Hi,
I'm sure this will be obvious, but I need to set up my _first_ FTP data source to retrieve a file from a server and import it to ServiceNow. I've reviewed the SNOW sites and Community and am having a hard time figuring out what needs to be set up. Are there any instructions documented that show what needs to be done to allow ServiceNow to reach a server in my company's network? For example, what IP addresses (and ports) need to be allowed through the firewall? If FTP is done on the mid server, are there instructions for setting up FTP there?
I'd like to retrieve a file with a unique name (e.g. date appended to the file name). I've read online this can be done, but some scripting may be required. Has anyone done this, and if so, can you please provide me with some instructions on where the scripting occurs? If you have examples of scripts, that would be extremely helpful
Thanks!
Jessica

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 10:39 PM
You can import using a public UserID/Pwd with access on that FTP server.
1) Create a Import set table and Transform map.
2) Create a Data Source
3) Attach SSL certificate in Certificate Table.
4) Create a Scheduled Import for this data source
5) Click on Conditional and use script like below to update File path name of data source before import.
chg= new GlideRecord('sys_data_source');
chg.addQuery('sys_id',''); //sys_id of your Data Source
if(chg.hasNext()){
//Logic for update your filename
chg.file_path = 'New Path from above logic';
}
chg.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 07:08 PM
Thank you very much! Now I understand where the script to update the file name should be placed. I really appreciate it.
Are you using SFTP and are you FTP-ing between a server and ServiceNow directly, or through the mid server? Did you have to open any firewall ports as part of your set up? If so, how did you know what IPs to use for ServiceNow?
Thanks again!
Jessica