# WriteData

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.GoogleSheets/tree/main/Frends.GoogleSheets.WriteData>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                     | Description                                                                                                                                                                                                                                     |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SpreadsheetId : `String` | <p>The spreadsheet ID of the Google Sheets document.</p><p><br>Default: <code>-</code><br>Example: <code>abcdef12345...98765ABC</code></p>                                                                                                      |
| StartingCell : `String`  | <p>The A1 notation of the starting cell where data will be written.</p><p><br>Default: <code>Sheet1!A1</code><br>Example: <code>Sheet1!A1</code></p>                                                                                            |
| Values : `String`        | <p>The values to write, formatted as a JSON string representing a 2D array.</p><p>Each inner array represents a row of values.</p><p><br>Default: <code>-</code><br>Example: <code>\[ \["Value1", "Value2"], \["Value3", "Value4"] ]</code></p> |
| {% endtab %}             |                                                                                                                                                                                                                                                 |

{% tab title="Parameter: Connection" %}

| Name                            | Description                                                                                                                                                                                       |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 🗝ServiceAccountJson : `String` | <p>JSON string containing service account credentials.</p><p><br>Default: <code>-</code><br>Example: <code>{ "type": "service\_account", "project\_id": ..., "private\_key\_id": ... }</code></p> |
| {% endtab %}                    |                                                                                                                                                                                                   |

{% tab title="Parameter: Options" %}

| Name                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean`    | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ErrorMessageOnFailure : `String`   | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| InsertDataMode : `InsertDataModes` | <p>Mode for inserting data into the sheet.</p><p>- InsertRows: Will append data after the last row with data, shifting existing rows down.</p><p>- UpdateOverwrite: Will overwrite existing data.</p><p>- AppendOverwrite: Will append data after the last row with data, overwriting any existing data in its way.</p><p>Possible values:</p><ul><li><code>InsertRows</code>:</li></ul><p>Mode for inserting data into the sheet.</p><p>- InsertRows: Will append data after the last row with data, shifting existing rows down.</p><p>- UpdateOverwrite: Will overwrite existing data.</p><p>- AppendOverwrite: Will append data after the last row with data, overwriting any existing data in its way.</p><ul><li><code>AppendOverwrite</code>:</li></ul><p>Mode for inserting data into the sheet.</p><p>- InsertRows: Will append data after the last row with data, shifting existing rows down.</p><p>- UpdateOverwrite: Will overwrite existing data.</p><p>- AppendOverwrite: Will append data after the last row with data, overwriting any existing data in its way.</p><ul><li><code>UpdateOverwrite</code>:</li></ul><p>Mode for inserting data into the sheet.</p><p>- InsertRows: Will append data after the last row with data, shifting existing rows down.</p><p>- UpdateOverwrite: Will overwrite existing data.</p><p>- AppendOverwrite: Will append data after the last row with data, overwriting any existing data in its way.</p><p><br>Default: <code>2</code><br>Example: <code>InsertRows</code></p> |
| ValueInputMode : `ValueInputModes` | <p>Mode for how the input data should be interpreted.</p><p>- UserEntered: The values the user has entered will be parsed as if the user typed them into the UI.</p><p>- Raw: The values will not be parsed and will be stored as-is.</p><p>Possible values:</p><ul><li><code>UserEntered</code>:</li></ul><p>Mode for how the input data should be interpreted.</p><p>- UserEntered: The values the user has entered will be parsed as if the user typed them into the UI.</p><p>- Raw: The values will not be parsed and will be stored as-is.</p><ul><li><code>Raw</code>:</li></ul><p>Mode for how the input data should be interpreted.</p><p>- UserEntered: The values the user has entered will be parsed as if the user typed them into the UI.</p><p>- Raw: The values will not be parsed and will be stored as-is.</p><p><br>Default: <code>0</code><br>Example: <code>UserEntered</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| {% endtab %}                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

{% tab title="Result: Result" %}

| Name                     | Description                                                                                                                    |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean`      | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                             |
| UpdatedRange : `String`  | <p>Updated range after write operation.<br>Example: <code>Sheet1!A1</code></p>                                                 |
| UpdatedRows : `Int32`    | <p>Number of updated rows after write operation.<br>Example: <code>5</code></p>                                                |
| UpdatedColumns : `Int32` | <p>Number of updated columns after write operation.<br>Example: <code>5</code></p>                                             |
| ETag : `String`          | <p>ETag of the response.<br>Example: <code>abc123etag</code></p>                                                               |
| Error : `Error`          | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p> |
| {% endtab %}             |                                                                                                                                |

{% tab title="Changelog" %}

## Changelog

### \[1.0.0] - 2025-09-10

#### Changed

* Initial implementation
  {% endtab %}
  {% endtabs %}
