Append sheet

Use this action to add rows of data to the Google Sheets document that was created when you set up the integration. This is handy for storing data from Home Assistant for further processing, for example, logging energy usage over time.

Using this action from the user interface

If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.

To append data from an automation or a script:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation or script, or select Create automation > Create new automation.
  3. If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
  4. In the Then do section, select Add action.
  5. From the search box, search for and select Google Sheets: Append sheet.
  6. Under Integration, select the Sheet you want to add to.
  7. Optionally, set the Worksheet and whether to add a Created column.
  8. Set the Data to append.
  9. Select Save.

This action does not support targets. You select the document through the Config entry field instead of choosing an area, device, entity, or label.

Options in the UI

Config entry (Required)

The Google Sheets document to add to.

Worksheet (Optional)

The name of the worksheet. Defaults to the first worksheet in the document.

Add created column (Optional)

Whether to add a created column with the date and time to the appended data.

Data (Required)

The data to append. Provide a mapping for a single row, or a list of mappings for multiple rows. Each mapping key becomes a column name.

Using this action in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.

In YAML, refer to this action as google_sheets.append_sheet. A basic example looks like this:

ActionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called *sequence*. [Learn more]
action: google_sheets.append_sheet
data:
  config_entry: 1b4a46c6cba0677bbfb5a8c53e8618b0
  worksheet: "Car Charging"
  add_created_column: false
  data:
    Date: "{{ now().strftime('%-d-%b-%y') }}"
    KWh: "{{ states('input_number.car_charging_kwh') | float(0) }}"
    Cost: "{{ states('input_number.car_charging_cost') | float(0) }}"

This appends a single row with the date, energy, and cost.

Options in YAML

config_entry string Required

The Google Sheets document to add to.

worksheet string

The name of the worksheet. Defaults to the first worksheet in the document.

add_created_column boolean

Whether to add a created column with the date and time to the appended data.

data map Required

The data to append. Provide a mapping for a single row, or a list of mappings for multiple rows. Each mapping key becomes a column name.

Try it yourself

Ready to test this? Open Developer tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.

Automation: append multiple rows at once

You can append more than one row in a single call by passing a list of mappings as the data.

YAML example for appending multiple rows
ActionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called *sequence*. [Learn more]
action: google_sheets.append_sheet
data:
  config_entry: 1b4a46c6cba0677bbfb5a8c53e8618b0
  worksheet: "Car Charging"
  data:
    - Item: "Car 1 cost"
      Cost: "{{ states('input_number.car_1_charging_cost') | float(0) }}"
    - Item: "Car 2 cost"
      Cost: "{{ states('input_number.car_2_charging_cost') | float(0) }}"

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.

Related actions

These actions work well alongside this one:

  • Get sheet: Retrieves rows of data from a Google Sheets document.