> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Write Data

> Send data from your workflows to Google Sheets spreadsheets.

**Write Data** takes data from previous workflow nodes and writes it to your Google Sheets spreadsheets. Essential for saving advertising reports, analytics data, or any processed information to your sheets for storage and analysis.

***

## Inputs

| Field                  | Type   | Required | Description                                                             |
| ---------------------- | ------ | -------- | ----------------------------------------------------------------------- |
| **Spreadsheet URL/ID** | Text   | Yes      | Google Sheets document link or ID                                       |
| **Working Sheet**      | Select | Yes      | Which sheet tab to write to                                             |
| **Write Mode**         | Select | Yes      | Overwrite existing data or append to end                                |
| **Starting Row**       | Number | Yes      | Row number where data writing begins                                    |
| **Data Mapping**       | Select | Yes      | Use all data or select specific columns                                 |
| **Data**               | Data   | Yes\*    | Data source from previous nodes (\*Required for "Use All Data")         |
| **Column Mapping**     | Mapper | Yes\*    | Map data to specific columns (\*Required for "Select Specific Columns") |
| **Add Headers**        | Switch | Yes      | Include column headers in the output                                    |

***

## How It Works

This node takes structured data from previous workflow nodes (like Google Ads, Analytics, etc.) and writes it to your specified Google Sheets location. You can either write all the data automatically or map specific fields to chosen columns.

### Write Mode Options

**Overwrite (Default):**

* Replaces existing data starting from your specified row
* Keeps data above your starting row intact
* Perfect for updating specific sections while preserving headers

**Append:**

* Adds new data to the end of existing data
* Preserves all historical records
* Great for accumulating data over time

**Clear Sheet Before Writing:**

* Removes all existing data from the entire sheet first
* Then writes new data starting from your specified row
* Perfect for complete sheet refreshes and clean starts

***

## Data Mapping Options

**Use All Data (Recommended):**

* Automatically writes all data from previous nodes
* Maintains original column structure and names
* Simplest option for complete data transfer

**Select Specific Columns:**

* Choose which data fields go to which sheet columns
* Customize column order and selection
* Perfect for targeted data placement

***

## Column Mapping Guide

When using "Select Specific Columns", map your data like this:

| Column | Data Field    | Example                   |
| ------ | ------------- | ------------------------- |
| **A**  | Campaign Name | Google Ads campaign names |
| **B**  | Clicks        | Click count data          |
| **C**  | Cost          | Spend amounts             |
| **D**  | Date          | Report date               |

**Column Format:** Use A, B, C, D... (not A1, B1, etc.)

***

## Configuration Examples

### Save Google Ads Report

**Scenario:** Write Google Ads campaign data to a tracking sheet

**Configuration:**

* **Spreadsheet URL/ID:** Your tracking spreadsheet link
* **Working Sheet:** "Campaign Data"
* **Write Mode:** "Overwrite"
* **Starting Row:** 2 (keeps headers in row 1)
* **Data Mapping:** "Use All Data"
* **Data:** Connect from Google Ads Get Report node
* **Add Headers:** On

**Result:** Complete campaign data written with headers.

### Append Daily Metrics

**Scenario:** Add today's performance data to historical log

**Configuration:**

* **Write Mode:** "Append"
* **Starting Row:** 1 (irrelevant for append)
* **Data Mapping:** "Use All Data"
* **Add Headers:** Off (headers already exist)

**Result:** New data added to end of existing records.

### Complete Sheet Refresh

**Scenario:** Replace all data with fresh weekly report

**Configuration:**

* **Write Mode:** "Clear Sheet Before Writing"
* **Starting Row:** 1
* **Data Mapping:** "Use All Data"
* **Add Headers:** On

**Result:** Sheet completely cleared, then populated with new data and headers.

### Custom Column Layout

**Scenario:** Write only specific metrics to predefined columns

**Configuration:**

* **Data Mapping:** "Select Specific Columns"
* **Column Mapping:**
  * A: Campaign Name
  * C: Clicks (skipping column B)
  * E: Cost
* **Add Headers:** On

**Result:** Data written to specified columns only.

***

## Best Practices

### Sheet Preparation

* **Set up headers** in row 1 before automation
* **Use consistent column names** across workflows
* **Format columns** appropriately (currency, dates, numbers)
* **Keep backup copies** of important sheets

### Write Mode Selection

* **Use Overwrite** for reports that update specific sections
* **Use Append** for accumulating historical data
* **Use Clear Sheet Before Writing** for complete data refreshes
* **Set Starting Row to 1** when clearing entire sheet
* **Set Starting Row to 2** when preserving existing headers (Overwrite mode)
* **Test with small data** before full automation

### Data Mapping Strategy

* **Start with "Use All Data"** for simplicity
* **Use "Select Specific Columns"** for custom layouts
* **Map important fields first** (dates, identifiers)
* **Keep column mapping consistent** across workflows

### Header Management

* **Turn on "Add Headers"** for new sheets, clear mode, or overwrite mode
* **Turn off "Add Headers"** when appending to existing data
* **Use descriptive header names** for clarity
* **Match header names** with your data source
* **Clear mode always removes existing headers** - turn on "Add Headers" to replace them

***

## Credit Cost

1 credit per successful run.

***

## FAQ

<Accordion title="What's the difference between the three write modes?">
  * **Overwrite replaces data** starting from your chosen row, keeping data above intact - good for updating sections.
  * **Append adds new data** to the end - perfect for historical tracking.
  * **Clear Sheet Before Writing removes everything** then writes fresh data - ideal for complete weekly/monthly refreshes without needing a separate Clear Data node.
</Accordion>

<Accordion title="When should I use 'Use All Data' vs 'Select Specific Columns'?">
  **Use 'Use All Data' when you want everything** from your data source - it's simpler and includes all fields automatically. **Use 'Select Specific Columns' when you need control** over which data goes where, or when your sheet has a specific layout to follow.
</Accordion>

<Accordion title="When should I use 'Clear Sheet Before Writing' vs the separate Clear Data node?">
  **Use 'Clear Sheet Before Writing' when you want to replace all data** in one step - perfect for weekly/monthly report refreshes. **Use the separate Clear Data node when you need more control** - like clearing specific ranges, or when you want to clear data but not immediately write new data back.
</Accordion>

<Accordion title="How do I handle headers correctly?">
  **Turn on 'Add Headers' for new sheets** or when overwriting completely. **Turn off 'Add Headers' when appending** to sheets that already have headers. Set Starting Row to 2 if you want to preserve existing headers in row 1.
</Accordion>

<Accordion title="What data can I write to Google Sheets?">
  **Any structured data from previous workflow nodes** - Google Ads reports, Analytics data, Meta Ads performance, etc. The data should be in table format with consistent columns. Numbers, text, dates, and percentages all work perfectly.
</Accordion>

<Accordion title="How do I know which columns to use in Column Mapping?">
  **Use A, B, C, D...** to represent columns (not A1, B1). Look at your Google Sheets - A is the first column, B is second, etc. You can skip columns if needed (map to A, then C, skipping B).
</Accordion>

<Accordion title="What happens if my sheet doesn't have enough rows or columns?">
  **Google Sheets automatically expands** to accommodate your data. If you're writing 100 rows of data to a 10-row sheet, it will expand. New columns are also created automatically as needed.
</Accordion>

<Accordion title="Can I write to multiple sheets at once?">
  **No, each Write Data node writes to one sheet tab at a time.** To write to multiple sheets, use multiple Write Data nodes in your workflow, each targeting a different sheet tab in your spreadsheet.
</Accordion>

<Accordion title="What happens to existing formatting when I write data?">
  **Overwrite mode may clear some formatting** in the affected cells. **Append mode preserves existing formatting.** For best results, apply formatting to entire columns rather than individual cells, and consider doing it after data writing is complete.
</Accordion>

<Accordion title="I'm getting 'Access denied to Google Sheet' error. How do I fix this?">
  This error means your Google Sheet isn't shared with our app's service account. Here's how to fix it:

  **Error message:** "Access denied to Google Sheet. Please share the spreadsheet with the app's service account email as instructed."

  **Solution:**

  1. **Find the service account email:** Click on any Google Sheets, Docs, or Slides node in your workflow
  2. **Look for "Show connection instructions"** - click this link
  3. **Copy the service account email** provided (it looks like: [something@markifact.iam.gserviceaccount.com](mailto:something@markifact.iam.gserviceaccount.com))
  4. **Share your Google Sheet** with this email:
     * Open your Google Sheet
     * Click "Share" (top right)
     * Paste the service account email
     * Set permissions to "Editor"
     * Click "Send"

  **Important:** This same service account email works for Google Sheets, Google Docs, and Google Slides. You only need to find it once from any Google node's connection instructions.

  **Still having issues?** Make sure you're sharing the exact spreadsheet URL/ID that you're using in your workflow, and that the service account has "Editor" permissions (not just "Viewer").
</Accordion>
