How to Copy Rows from Google Sheets to another Google Sheet
You can use Document Studio to copy rows from one Google Sheet to another automatically, whenever new rows are added to the original Google Sheet. You can also use the add-on to copy rows in bulk from an existing Google Sheet to another Google Sheet or a different tab in the same Google Sheet.
For this example, we have a Google Sheet recording the sales data of a store. We need to copy this data into a separate Google Sheet, such that whenever new rows are added to the original sheet, they are automatically copied to the new sheet as well.
There are existing Sheet functions, IMPORTRANGE
for example, that let you pull data from one Google Sheet to another but it requires you to grant access to the sheet for another user to import data. With Document Studio, a copy of the data is made to the other sheet without you having to grant anyone access to the source spreadsheet.
Create Workflowβ
Install Document Studio and open your Google Sheet to launch the add-on. Create a new workflow, give a descriptive name, and click Continue
to move to the conditions page.
On the Conditions
pane, specify if you want your workflow to run only if the Google Sheet row satisfies certain conditions. For instance, if the source spreadsheet has sales data for all regions and you would like to copy data specific to North America in another sheet, you can put that condition here. By default, the workflow will run for all rows in the Google Sheet. Click Continue
to move to the tasks section.
Connect to Google Sheetsβ
Choose the Copy Row
task from the list of available tasks and select Google Sheets
from the list of available spreadsheet services. You can also copy rows from Google Sheets to other spreadsheet providers including Microsoft Excel and Zoho Sheets.
From the Google file picker window, choose the Google spreadsheet where you want the rows to be copied.
If you already have an existing sheet in the selected spreadsheet where you want the rows to be copied, specify its name in the Sheet Name field. You can also create a new sheet by specifying a new name in this field. You can also use dynamic markers for naming the sheet.
Field Mappingβ
The next section is Field Mapping
where you define the source columns that should be mapped to the columns in the destination sheet.
Field Name: represents the heading of the column created in the worksheet Field Value: represents the dynamic values that will be stored in that column according to the actual cell values in the sheet.
For instance, if a column in the source sheet is titled βZipβ and you would like to store it as βPostal Codeβ, the mapping would look like this:
Field Name | Field Value |
---|---|
Postal Code | {{ Zip }} |
You have a list of default fields available, including the columns in the existing sheet. You can edit the field names, delete an entire field, and add as many new fields as you want.
Click Done
to save this task.
Activate Workflowβ
Click on Continue
to proceed to the triggers screen.
If you want the workflow to be automatically triggered every hour, so that any new rows added in that duration are processed automatically, you can choose the option Run workflow every hour
and then click on the Save
button. The workflow will also appear in the workflow dashboard where you can edit, delete, or manually run the workflow.
Alternatively, you can choose to run it immediately by simply clicking the Save and Run
button. This will immediately copy the matching rows from the source Google Sheet to the destination Google Sheet as per the field mapping you have defined.