SSIS Tip: How to import Google Sheets into MongoDB

Introduction

Need to transfer collaborative data from Google Sheets into MongoDB for analysis, backups, or system integration? With SSIS and the ZappySys SSIS PowerPack, it’s simpler than ever.

In this tutorial, you’ll learn how to extract data from Google Sheets using the API Source with the Google Sheets Connector and load it directly into MongoDB—no scripting required.

Prerequisites

Steps

Step 1: Create or select a project in the Google API Console

  1. Go to the Google API Console.

  2. Click the project dropdown at the top and either select an existing project or click Create Project.

  3. Once the project is created, click ENABLE APIS AND SERVICES.

  4. Search for and enable Google Sheets API and Google Drive API.

  5. Go to the OAuth Consent Screen tab. Fill in the required information and save.

  6. Navigate to the Credentials tab.

  7. Click Create Credentials then OAuth Client ID, select Desktop App, and click Create.

  8. Copy your Client ID and Client Secret—you’ll use these in SSIS.

Step 2: Configure the source component in SSIS

  1. In your SSIS package, drag a Data Flow Task onto the Control Flow canvas.

  2. Inside the Data Flow tab, drag the API Source component.

  3. Double-click the API Source, click New Connection, and choose Google Sheets Connector.

  4. Authenticate using OAuth 2.0, enter your Client ID and Client Secret and select the required scopes.

  5. Generate and save the token, and click Test Connection to verify access.

  6. Click OK to save the connection.

  7. In the API Source component, select your desired table or endpoint.

  8. Enter additional parameters if needed.

  9. Preview the data and click OK to finish the setup.

Step 3: Configure the MongoDB Destination

  1. In the Connection Manager, right-click and choose New Connection, then select ZS-MONGODB.

  2. Configure the MongoDB connection, set the host, username, password, and database.

  3. Adjust the advanced settings if necessary, and then click Test Connection to verify if the connection passes.

  4. Drag a MongoDB Destination component into the Data Flow and connect it to the API Source.

  5. Configure the destination. In the Connection Manager tab, select your MongoDB connection.

  6. In the Component Properties tab, set Action to Insert, and choose your collection name.

  7. In the Column Mappings tab, verify that fields are mapped (they will auto-map if names match).

  8. Run the package and verify that the inserted data is present in MongoDB.

Step 4: Updating MongoDB Records

To update existing records in MongoDB, pass the entire document JSON in one field and the key (e.g., ID) in another.

  1. Add a JSON Generator Transform between the API Source and MongoDB Destination.

  2. Define the desired JSON structure in the transform. (Refer to JSON Generator Transform Documentation).

  3. Right-click the ID field, then Edit and enable Include Column in the Downstream.

  4. In the MongoDB Destination, set Action to Update or UpdateOrInsert.

  5. Go to the Column Mappings tab, map the generated JSON to the document field and the ID field to the key.

  6. Run the package. Matching MongoDB documents will be updated.

Conclusion

Exporting Google Sheets data into MongoDB doesn’t require scripting, custom APIs, or complex pipelines. With ZappySys API Source and MongoDB Destination, you can build powerful, low-code ETL pipelines using familiar SSIS tools. Whether you’re integrating spreadsheets from business teams or syncing external data sources, this method offers a flexible, reliable, and scalable solution.

For more advanced file, API, and cloud integrations, explore the full capabilities of the ZappySys SSIS PowerPack.

References

Contact us

If you encounter any challenges or have specific use cases, please contact our support team via chat or ticket.