FTP connector methods

  • Release version: Xanadu
  • Updated August 1, 2024
  • 4 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of FTP connector methods

    The FTP connector methods in ServiceNow enable automated interactions with a File Transfer Protocol (FTP) server. These methods facilitate common file and folder operations such as creating, deleting, renaming, uploading, and downloading, which are essential for automating file management in enterprise workflows.

    Show full answer Show less

    To use these methods, you must first set the FTP server access details via the SetConfiguration method. Each method requires specific parameters to be provided, ensuring precise control over FTP server operations.

    Key Methods and Parameters

    • SetConfiguration: Initializes FTP server access by providing URL, username, and password. This method must be called first before other operations.
    • CreateFolder: Creates a new folder on the FTP server at the specified path. Returns a Boolean indicating success.
    • DeleteFile / DeleteFolder: Removes a specified file or folder on the FTP server. Return values indicate operation success.
    • DownloadFile / DownloadFolder: Transfers files or folders from the FTP server to a local drive. Parameters include remote and local paths, with optional timeout. Return indicates success.
    • GetFileList: Retrieves a list of files from a specified folder on the FTP server.
    • RenameFile / RenameFolder: Changes the name of a file or folder on the FTP server, requiring current and new names. Returns success status.
    • UploadFile / UploadFolder: Uploads files or folders from the local drive to the FTP server, requiring local and remote paths. Returns success status.

    Practical Use and Benefits

    ServiceNow customers can leverage these FTP connector methods to automate file transfers and management tasks, improving efficiency and reducing manual errors. By providing clear parameter requirements and return values, the methods support robust automation scripting and integration with other ServiceNow workflows.

    Implementing these methods enables reliable interaction with FTP servers, facilitating tasks such as batch file uploads, remote folder management, and file synchronization essential for enterprise IT operations.

    The FTP connector methods perform various actions on the File Transfer Protocol server as part of an automation. To enable the methods, you must provide appropriate parameters.

    SetConfiguration

    Sets the File Transfer Protocol server access details. You must execute this method first.

    To provide inputs to the parameters, see Configure port properties.

    Table 1. SetConfiguration method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    Url URL of the File Transfer Protocol Data in String None Yes
    Username Username to access the File Transfer Protocol server. Data in String None Yes
    Password Password to access the File Transfer Protocol server. Data in String None Yes

    CreateFolder

    Creates a folder on the File Transfer Protocol server.

    To provide inputs to the parameters, see Configure port properties.

    Table 2. CreateFolder method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    FolderName Path in the File Transfer Protocol server where the folder will be created with the folder name. Data in String None Yes
    Return Returns True if the folder is created, else, returns False. Data out Boolean None Not applicable

    DeleteFile

    Deletes a file in the FTP server.

    To provide inputs to the parameters, see Configure port properties.

    Table 3. DeleteFile method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    RemoteFilePath Path to the file you want to remove in the File Transfer Protocol server. Data in String None Yes
    Return Returns True if the file is deleted, else, returns False. Data out Boolean Not applicable Not applicable

    DeleteFolder

    Deletes the specified folder in the File Transfer Protocol server.

    To provide inputs to the parameters, see Configure port properties.

    Table 4. DeleteFolder method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    RemoteFolderPath Path to the folder in the File Transfer Protocol server including the folder name. Data in String None Yes
    Return Returns True if the folder is deleted, else, returns False. Data out Boolean Not applicable Not applicable

    DownloadFile

    Downloads a file from the File Transfer Protocol server to the local drive.

    To provide inputs to the parameters, see Configure port properties.

    Table 5. DownloadFile method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    RemoteFile Path to the file in the File Transfer Protocol and the name of the file. Data in String None Yes
    LocalFile Path in the local drive where the file will be downloaded. Data in String None Yes
    TimeOut Time after which the request to the File Transfer Protocol server times out. Data in Integer None No
    Return Returns True if the file is downloaded, else, returns False. Data out Boolean None Not applicable

    DownloadFolder

    Downloads a folder from the File Transfer Protocol server to the local drive.

    To provide inputs to the parameters, see Configure port properties.

    Table 6. DownloadFolder method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    RemoteFolderPath Path to the folder in the File Transfer Protocol and the name of the folder. Data in String None Yes
    LocalFolderPath Path in the local drive where the folder will be downloaded. Data in String None Yes
    TimeOut Time after which the request to the File Transfer Protocol server times out. Data in Integer None No
    Return Returns True if the folder is downloaded, else, returns False. Data out Boolean None Not applicable

    GetFileList

    Returns the list of files in a folder in the File Transfer Protocol server.

    To provide inputs to the parameters, see Configure port properties.

    Table 7. GetFileList method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    RemoteFolderPath Path to the folder in the File Transfer Protocol and the name of the folder. Data in String None Yes
    Return Returns the list of files in the folder. Data out String Not applicable Not applicable

    RenameFile

    Renames a file in the File Transfer Protocol server.

    To provide inputs to the parameters, see Configure port properties.

    Table 8. RenameFile method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    RemoteFilePath Path to the file in the File Transfer Protocol server and the name of the file. Data in String None Yes
    NewNameofFile Path to the file in the File Transfer Protocol server and the new name of the file. Data in String None Yes
    Return Returns True if the name of the file is changed, else, it returns False. Data out Boolean Not applicable Not applicable

    RenameFolder

    Renames a folder in the File Transfer Protocol server.

    To provide inputs to the parameters, see Configure port properties.

    Table 9. RenameFolder method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    RemoteFolder Path to the folder in the File Transfer Protocol server and the name of the folder. Data in String None Yes
    NewNameofFolder Path to the folder in the File Transfer Protocol server and the new name of the folder. Data in String None Yes
    Return Returns True if the name of the folder is changed, else, it returns False. Data out Boolean Not applicable Not applicable

    UploadFile

    Uploads a file from the local drive to the File Transfer Protocol server.

    To provide inputs to the parameters, see Configure port properties.

    Table 10. UploadFile method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    LocalFilePath Path to the file in the local drive. Data in String None Yes
    RemoteFilePath Path to the location in the File Transfer Protocol server. Data in String None Yes
    Return Returns True if the file is uploaded, else, returns False. Data out Boolean Not applicable Not applicable

    UploadFolder

    Uploads a folder from the local drive to the File Transfer Protocol server.

    To provide inputs to the parameters, see Configure port properties.

    Table 11. UploadFolder method parameters
    Parameter Description Data port type Data type Default value Mandatory?
    LocalFolderPath Path to the folder in the local drive. Data in String None Yes
    RemoteFolderPath Path to the location in the File Transfer Protocol server. Data in String None Yes
    Return Returns True if the folder is uploaded, else, returns False. Data out Boolean Not applicable Not applicable