Skip to main content

Overwrite vs Append

Introduction

The Castodia Database Connector provides two options before running a query: overwrite and append. Each option will refresh your data differently, depending on what you're trying to accomplish. In this article, we'll walk through the differences between the two. ‍

Overwrite

The overwrite function overwrites your data with new data from the database. However note that Castodia overwrite is a smart overwrite, meaning that it will not overwrite the entire spreadsheet, rather it will only overwrite the necessary columns to fit the data. When you run with the overwrite option selected, only the columns indicated in the new query are replaced, or "overwritten". This way, users can keep formulas in the rightmost columns that gets pulled from the database, without having those overwritten. ‍Smart Overwrite keeps columns to the right of the data intact to make it easy to build formulas from the refreshed data.

caution

While smart overwrite only overwrite columns with data, if your query returns more columns as a result of changes in the database or returned data, it's possible that your formulas could still be overwritten. When writing formulas to the right of the imported data, plan for additional empty columns between the data table and your formulas in case more than the expected number of columns is returned from running a query.

Append

The append function takes the result of your query and loads them to your Google Sheets, starting on the first empty row available after your existing data in Google Sheets. So if your last data in Google Sheets ends in e.g. row 57, the next row appended to your google sheets will be on row 58 onwards.‍