ServiceNow Connector for SSIS How to Download Table Attachments By Parent Row Search

Prerequisites

Before we begin, make sure the following prerequisites are met:

  1. SSIS designer installed. Sometimes it is referred as BIDS or SSDT (download it from Microsoft).
  2. Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.
  3. SSIS PowerPack is installed (if you are new to SSIS PowerPack, then get started!).

Download Table Attachments By Parent Row Search in SSIS

  1. Begin with opening Visual Studio and Create a New Project.

  2. Select Integration Service Project and in new project window set the appropriate name and location for project. And click OK.

    In the new SSIS project screen you will find the following:

    • SSIS ToolBox on left side bar
    • Solution Explorer and Property Window on right bar
    • Control flow, data flow, event Handlers, Package Explorer in tab windows
    • Connection Manager Window in the bottom
    SSIS Project Screen
    Note: If you don't see ZappySys SSIS PowerPack Task or Components in SSIS Toolbox, please refer to this help link.
  3. Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox. Double click on the Data Flow Task to see Data Flow designer.

    SSIS Data Flow Task - Drag and Drop
  4. From the SSIS toolbox drag and API Source (Predefined Templates) on the data flow designer surface, and double click on it to edit it:

    SSIS API Source (Predefined Templates) - Drag and Drop
  5. Select New Connection to create a new connection:

    API Source - New Connection
  6. Use a preinstalled ServiceNow Connector from Popular Connector List or press Search Online radio button to download ServiceNow Connector. Once downloaded simply use it in the configuration:

    ServiceNow
    ServiceNow Connector Selection
  7. Now it's time to configure authentication. Firstly, configure authentication settings in ServiceNow service and then proceed by configuring API Connection Manager. Start by expanding an authentication type:

    ServiceNow authentication

    Authenticate using ServiceNow instance username and password.

    Locate your ServiceNow instance credentials and use them for HTTP authentication:

    1. Go to https://developer.servicenow.com/dev.do and log in.
    2. Click on your profile picture.
    3. When a menu appears, click on Manage instance password or a similar option:

      Manage instance password in ServiceNow
    4. In a new window you will see your HTTP Basic Authentication credentials:

      Use instance credentials to authenticate to ServiceNow
    5. Done! Use this username and password when configuring HTTP Authentication parameters.

    API Connection Manager configuration

    Just perform these simple steps to finish authentication configuration:

    1. Set Authentication Type to Basic Auth (UserName and Password) [Http]
    2. Optional step. Modify API Base URL if needed (in most cases default will work).
    3. Fill in all the required parameters and set optional parameters if needed.
    4. Finally, hit OK button:
    ServiceNow
    Basic Auth (UserName and Password) [Http]
    https://[$InstanceName$].service-now.com/api/now
    Required Parameters
    InstanceName (e.g. mycompany) Fill-in the parameter...
    User name Fill-in the parameter...
    Password Fill-in the parameter...
    Optional Parameters
    ApiVersion v2
    RetryMode RetryWhenStatusCodeMatch
    RetryStatusCodeList 429
    RetryCountMax 5
    RetryMultiplyWaitTime True
    Date Time Value Handling
    ZappySys Http Connection
    ServiceNow authentication

    Authenticate using OAuth 2.0 Authorization Code Flow (3-legged)

    Create OAuth application and use it for authentication:

    1. Login to your instance at https://your-instance-id.service-now.com.
    2. Start by clicking on menu item All, then search for oauth, and click Application Registry option:

      Locate OAuth configuration in ServiceNow
    3. Then click button New:

      Create new OAuth application in ServiceNow
    4. Continue by clicking Create an OAuth API endpoint for external clients option:

      Use ServiceNow OAuth application for external clients
    5. Move on by naming your OAuth application and entering a Client Secret (or let it be generated automatically).

    6. Click on the lock icon next to the Redirect URL. Enter https://zappysys.com/oauth. This is not needed if you use Client Credentials Grant or Password Grant
    7. Finally give it a final touch by increasing the Refresh Token Lifespan value to 315,360,000 (it should last for 10 years):

      Configure OAuth application in ServiceNow
    8. Change Default Grant Type as per your need.
      NOTE: If you prefer to use Client Credentials grant (Service account style access without using real userid-password) then your admin must enable it. Client Credentials is only supported on instances where it is explicitly enabled by the ServiceNow administrator. Its not supported in Dev / Free instance.
    9. Done! Now you can use Client ID and Client Secret when configuring OAuth Authentication parameters.

    Enable Client Credentials Grant Type

    • Enable the Client Credentials Grant Type: Go to System Properties > All Properties, create a new property named glide.oauth.inbound.client.credential.grant_type.enabled, and set it to true.
    • Configure the OAuth Application: Navigate to System OAuth > Application Registry, click New, and select Create an OAuth API endpoint for external clients. Set the name and save the record. In the Default Grant Type field, select Client Credentials and associate it with the integration user.
    API Connection Manager configuration

    Just perform these simple steps to finish authentication configuration:

    1. Set Authentication Type to OAuth Authorization Code Grant (User Creds) [OAuth]
    2. Optional step. Modify API Base URL if needed (in most cases default will work).
    3. Fill in all the required parameters and set optional parameters if needed.
    4. Press Generate Token button to generate the tokens.
    5. Finally, hit OK button:
    ServiceNow
    OAuth Authorization Code Grant (User Creds) [OAuth]
    https://[$InstanceName$].service-now.com/api/now
    Required Parameters
    Redirect URI (***Must match as App Registry Page***) Fill-in the parameter...
    ZappySys OAuth Connection
    ServiceNow authentication

    Authenticate using OAuth Client Credentials Grant (Client ID and Client Secret). [API reference]

    Create OAuth application and use it for authentication:

    1. Login to your instance at https://your-instance-id.service-now.com.
    2. Start by clicking on menu item All, then search for oauth, and click Application Registry option:

      Locate OAuth configuration in ServiceNow
    3. Then click button New:

      Create new OAuth application in ServiceNow
    4. Continue by clicking Create an OAuth API endpoint for external clients option:

      Use ServiceNow OAuth application for external clients
    5. Move on by naming your OAuth application and entering a Client Secret (or let it be generated automatically).

    6. Click on the lock icon next to the Redirect URL. Enter https://zappysys.com/oauth. This is not needed if you use Client Credentials Grant or Password Grant
    7. Finally give it a final touch by increasing the Refresh Token Lifespan value to 315,360,000 (it should last for 10 years):

      Configure OAuth application in ServiceNow
    8. Change Default Grant Type as per your need.
      NOTE: If you prefer to use Client Credentials grant (Service account style access without using real userid-password) then your admin must enable it. Client Credentials is only supported on instances where it is explicitly enabled by the ServiceNow administrator. Its not supported in Dev / Free instance.
    9. Done! Now you can use Client ID and Client Secret when configuring OAuth Authentication parameters.

    Enable Client Credentials Grant Type

    • Enable the Client Credentials Grant Type: Go to System Properties > All Properties, create a new property named glide.oauth.inbound.client.credential.grant_type.enabled, and set it to true.
    • Configure the OAuth Application: Navigate to System OAuth > Application Registry, click New, and select Create an OAuth API endpoint for external clients. Set the name and save the record. In the Default Grant Type field, select Client Credentials and associate it with the integration user.
    API Connection Manager configuration

    Just perform these simple steps to finish authentication configuration:

    1. Set Authentication Type to OAuth Client Credentials Grant (Must be enabled by Admin) [OAuth]
    2. Optional step. Modify API Base URL if needed (in most cases default will work).
    3. Fill in all the required parameters and set optional parameters if needed.
    4. Finally, hit OK button:
    ServiceNow
    OAuth Client Credentials Grant (Must be enabled by Admin) [OAuth]
    https://[$InstanceName$].service-now.com/api/now
    There are no parameters to configure.
    ZappySys OAuth Connection
    ServiceNow authentication

    Authenticate using OAuth Password Grant (ServiceNow instance username, password, OAuth Client ID, and Client Secret). [API reference]

    Create OAuth application and use it for authentication:

    1. Login to your instance at https://your-instance-id.service-now.com.
    2. Start by clicking on menu item All, then search for oauth, and click Application Registry option:

      Locate OAuth configuration in ServiceNow
    3. Then click button New:

      Create new OAuth application in ServiceNow
    4. Continue by clicking Create an OAuth API endpoint for external clients option:

      Use ServiceNow OAuth application for external clients
    5. Move on by naming your OAuth application and entering a Client Secret (or let it be generated automatically).

    6. Click on the lock icon next to the Redirect URL. Enter https://zappysys.com/oauth. This is not needed if you use Client Credentials Grant or Password Grant
    7. Finally give it a final touch by increasing the Refresh Token Lifespan value to 315,360,000 (it should last for 10 years):

      Configure OAuth application in ServiceNow
    8. Change Default Grant Type as per your need.
      NOTE: If you prefer to use Client Credentials grant (Service account style access without using real userid-password) then your admin must enable it. Client Credentials is only supported on instances where it is explicitly enabled by the ServiceNow administrator. Its not supported in Dev / Free instance.
    9. Done! Now you can use Client ID and Client Secret when configuring OAuth Authentication parameters.

    Enable Client Credentials Grant Type

    • Enable the Client Credentials Grant Type: Go to System Properties > All Properties, create a new property named glide.oauth.inbound.client.credential.grant_type.enabled, and set it to true.
    • Configure the OAuth Application: Navigate to System OAuth > Application Registry, click New, and select Create an OAuth API endpoint for external clients. Set the name and save the record. In the Default Grant Type field, select Client Credentials and associate it with the integration user.
    API Connection Manager configuration

    Just perform these simple steps to finish authentication configuration:

    1. Set Authentication Type to OAuth Password Grant [OAuth]
    2. Optional step. Modify API Base URL if needed (in most cases default will work).
    3. Fill in all the required parameters and set optional parameters if needed.
    4. Finally, hit OK button:
    ServiceNow
    OAuth Password Grant [OAuth]
    https://[$InstanceName$].service-now.com/api/now
    Required Parameters
    User name Fill-in the parameter...
    Password Fill-in the parameter...
    ZappySys OAuth Connection
  8. Select Download Table Attachments By Parent Row Search endpoint from the dropdown and hit Preview Data:

    API Source - ServiceNow
    Read and write ServiceNow data effortlessly. Integrate, manage, and automate incidents, tasks, attachments, and records — almost no coding required.
    ServiceNow
    Download Table Attachments By Parent Row Search
    Required Parameters
    SaveFolder Fill-in the parameter...
    Optional Parameters
    OverwriteFile True
    ContinueOn404Error True
    Attachment Filter / Order By
    SSIS API Source - Read from table or endpoint
  9. That's it! We are done! Just in a few clicks we configured the call to ServiceNow using ServiceNow Connector.

    You can load the source data into your desired destination using the Upsert Destination , which supports SQL Server, PostgreSQL, and Amazon Redshift. We also offer other destinations such as CSV , Excel , Azure Table , Salesforce , and more . You can check out our SSIS PowerPack Tasks and components for more options. (*loaded in Trash Destination)

    Execute Package - Reading data from ServiceNow and load into target

More actions supported by ServiceNow Connector

Learn how to perform other actions directly in SSIS with these how-to guides:

More integrations

All
Data Integration
Database
BI & Reporting
Productivity
Programming Languages
Automation & Scripting
ODBC applications