Create Excel File in SSIS (Read from JSON / XML)

Introduction

json to excel

In this post, we will learn how to Create Excel File in SSIS from source like JSON / XML.  We will use SSIS PowerPack to connect and query a JSON or XML file. This article also covers creating Excel from JSON File.

JSON stands for JavaScript Object Notation and it is an Open and Standard format to read an object with attributes and values.  JSON is replacing XML because it is faster to read data, it is easier to parse data, it does not require end tags, it is shorter and it can use arrays.

 

Prerequisite

  1. First, you will need to have SSIS installed
  2. Secondly, make sure to have SSDT
  3. Make sure that Microsoft Excel installed
  4. Finally, do not forget to install ZappySys SSIS PowerPack

 

Components Mentioned in this article

What is JSON File Source

JSON Source Connector can be used to extract and output JSON data stored in local JSON files, JSON data coming from REST API web service calls (Web URL) or direct JSON String (variables or DB columns). JSON component also supports JSONPath to filter data from nested array/sub-documents. This component is optimized to work with very large files.

What is XML File Source

SSIS XML Source can be used to consume multiple XML files or XML formatted response from SOAP Web service or REST API Web Service. It supports advanced filtering along with a flexible approach to configuring request parameters for web service.

Getting Started

In order to start, we will show several examples. ZappySys includes an SSIS JSON Source for JSON or XML File as well as REST API that will help you in reading JSON or XML Files from JSON or XML File to the Local machine. Here we are showing you is, How to Load JSON or XML Data in Excel File using SSIS Pack.

Getting Started – Create Excel File in SSIS

Let´s start with an example. In this SSIS JSON or XML Source for JSON or XML File task example, we will read JSON or XML files from Microsoft Excel File.

  1. First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

  2. Drag and Drop relevant JSON or XML Source(REST API and File) for JSON or XML File Task from the SSIS Toolbox.
    SSIS Add JSON or XML Source

    SSIS Add JSON or XML Source

  3. Double Click on JSON or XML Source (REST API or File) for edit.
    SSIS Json/XML Source File

    SSIS Json/XML Source File

  4. JSON and XML Source Task is able to do more various call of Rest API using Http and Oauth2 Connection also Please refer below articles link for the same
  5. Now let’s create the Excel File Connection. In the connection Manager Window right click and select new connection.
    Create Excel File Connection

    Create Excel File Connection

     

  6. And Create The Zs-Excel Type Connection. And click Add.
    Add Excel Connection

    Add Excel Connection

     

  7. Now select the excel file path in and test connection.
    Select Excel File For Connection

    Select Excel File For Connection

     

  8.  Now add Our Excel File Destination Connector and connect upper JSON or XML source with it
    https://zappysys.com/products/ssis-powerpack/ssis-excel-file-destination/
  9.  And now edit the Excel destination and select that created excel file connection to load the data in excel file.
    SSIS Excel Connection Advanced Edit

    SSIS Excel Connection Advanced Edit

     

  10. Give the Range Start cell in Component Properties. (A1 for starting of the file) and select the table name.
    Give RangeStartCell and TableName

    Give RangeStartCell and TableName

     

  11.  Select the input columns.
    Select Input Columns

    Select Input Columns

  12. That’s run the package and it will load all the JSON or XML File data into the Excel file.
    run-package-for-json-into-excel-file

    run-package-for-json-into-excel-file

    Stored Data into Excel File

    Stored Data into Excel File

     

Conclusion

Above all, in this blog, we learned how to Load JSON or XML Data in Excel File using SSIS Pack. We used JSON or Excel Source(REST API or File) for JSON or Excel fileExcel Destination for Excel file to read the JSON or XML file and load data into Excel File. You can download SSIS PowerPack here to try many other scenarios not discussed in this blog along with 70+ other components.

References

Finally, you can use the following links for more information:

Posted in SSIS Excel Connection, SSIS Excel Destination, SSIS JSON Source (File/REST), SSIS XML Source (File / SOAP) and tagged , , , .