Push to Google Sheets
Push sends baked ScriptableObject (SO) values to the live Google sheet, cell by cell. It is designed so that it never corrupts a live sheet that someone else is editing.
This page is not about ↑ Send in the toolbar. That button runs a reflect, which writes your staged edits to the source. See How an edit reaches the sheet.
Run a push
In the Data Studio toolbar, open Google Sheets. The dialog shows the Google connection of the open workbook, with the same fields as its settings Inspector. Press Push to Google Sheet there.
Push to Google Sheet is disabled, with the reason spelled out, unless the open workbook's source is Google Sheets in API mode.
A scope dialog opens first. It lists every workbook the push reaches and which Google sheet each one is sent to. Send runs the push for exactly the workbooks shown, and Cancel sends nothing.
When Export and Push apply to is set to all active workbooks, the scope dialog lists every active workbook. Each workbook's approval is asked before its progress bar opens, so an approval never sits under a bar.
The scope dialog also names the workbooks it skips, each with the reason. A workbook is skipped when its source is not Google Sheets, or when its exits (codegen, bake, Export and Push) are blocked. A failure in one workbook does not stop the others.
After a push, check how many cells the report says were applied and skipped. If cells were skipped, re-import to reconcile, then push again.
What push guarantees
Three guarantees follow from the safety chain:
- Nothing is sent without your approval of a cell-level plan.
- A cell that changed on the live sheet after your import is skipped, never overwritten.
- A row deletion goes out only when the live sheet still shows that key on that exact row. Anything that drifted is skipped with a notice, never guessed at.
The safety chain
Push runs five stages, in the order below.
Credentials
Push requires SheetsApi credentials. In ExportUrl mode, push is refused before any network call, with GooglePushRequiresSheetsApi.
Key column
Every pushed tab requires a key column. A keyless tab with changes is refused with PushKeylessTabUnsupported.
Push re-locates each row by key in the live sheet. That is how it detects a row that moved. It skips that write safely and never sends it to the wrong row.
Plan and approval
Push computes a cell-level diff between the baseline and the current SO. The diff becomes a plan of writes, appends and row deletions.
The plan is shown for explicit approval before anything is sent. Deletions stand in their own section, each named by the key that will disappear.
If you reject the plan, zero cells are sent.
Live re-fetch
Immediately before sending, push fetches the live sheet again and compares it with the baseline. Conflicting cells are skipped, not overwritten. Each conflict is reported as a warning.
| Warning | Meaning |
|---|---|
PushConflictCellChanged | A third party edited that cell |
PushConflictRowMoved | The key was found at a different row than your import saw |
PushConflictRowMissing | The row was deleted externally |
PushConflictDuplicateLiveKey | The target is ambiguous |
PushConflictAppendKeyExists | The target is ambiguous |
On PushConflictRowMoved, the write is skipped and never sent to the wrong row. Re-import to re-sync, then push again.
Row deletions
Row deletions are matched by key before they are sent. A record you deleted is removed from the live sheet only after the pre-send fetch confirms its key. The key must still sit on the exact row your import saw.
| Live sheet | Result |
|---|---|
| The row is already gone | Counts as done. A second push deletes nothing twice |
| The key is on a different row, because the sheet drifted | Skipped with a notice. Never deleted by position |
Deletions go out last, bottom-up inside each tab. Earlier removals therefore cannot shift the coordinates of later ones.
A source that cannot delete rows, such as a custom provider without the capability, does not delete. The deletion is reported, and the live row is left for you to remove.
Structure changes to Google
Structure edits on a Google source rewrite the whole target tab. Structure edits are column edits, marker edits, reorders and renames.
A live-diff check comes first. Explicit approval is required before the rewrite overwrites anything that changed on the sheet after your last import.
Value edits stay surgical, one cell at a time. Only structure uses the rewrite path.
Dropdowns written into the sheet
A column whose choices are finite gets a data-validation rule attached to the sheet. The person editing in Google Sheets or Excel picks from a list instead of remembering spellings.
Nothing has to be turned on. The rules are computed on every Export, every Push and every reflect. They are applied wherever the target can carry them.
Columns that get a rule
| Column | Rule |
|---|---|
Enum<T> scalar | A fixed list of that enum's members |
| Reference scalar | A range over the target tab's key column |
List<>, wrapper columns, the key column itself | No rule |
A reference scalar is a RecordId@Tab column, or a custom type with reference parity. Reference parity explains how a custom type opts in.
The range is left open-ended. Records added to the target tab join the list on their own.
List<> columns, wrapper columns and the key column itself get no rule, because one cell holds several values there, or because there is no target to list.
Rules warn but never reject
Every rule is non-strict. In Google the rule is strict:false, and in xlsx it is showErrorMessage="0". A value outside the list is flagged with a warning marker but still accepted.
Hard rejection would break the ordinary workflow of writing the reference first and defining the record later. It would also fight the import's own nearest-match suggestions.
Display metadata, not values
The rules never appear in a cell, so the round-trip is unaffected. An export with no rules is byte-identical to one produced before dropdown rules existed.
Rules are attached in a separate step
Attaching rules is its own step. It is not a side effect of writing cells, and it runs independently of the values.
The most common flow is to add an enum member and change no data. That flow sends zero cells, so a side effect would never run.
Attaching is idempotent. Running it again changes nothing.
When attaching fails
A failure to attach rules is a warning, not a failed push. If the values went out and only the rules could not be attached, the push still succeeded. Run the push again, and only the rules are applied again.
What each format carries
| Target | Mechanism | Rule kinds |
|---|---|---|
| Google Sheets, on Push and reflect | setDataValidation, batched into one request | Both |
| xlsx, on Export | dataValidations after the sheet data | Both |
| TSV and CSV, on Export | None | None |
| JSON, on Export | None | None |
In Google Sheets, the reference range omits its end row. The range follows the target tab as it grows.
In xlsx, the export is one xlsx file. A reference range therefore points at the target sheet's key column inside the same file, open-ended down the sheet. It has the same meaning as the Google range.
Plain text has nowhere to put a rule, so TSV and CSV carry none. JSON is a data file, not a spreadsheet. It has no cell to attach a dropdown to.
Rules that xlsx skips
An xlsx rule is still skipped, and named in the warning, in three cases:
- A list member contains a comma. The inline separator would split it.
- An inline list is over the 255-character spec limit. The format caps the whole quoted list.
- A range's target tab is not in the xlsx file.
Columns left out
Anything left out is reported as a single DropdownNotSupportedByFormat warning per run. The warning names every affected column. If Google has dropdowns and your file has none, the report says why.
It is a warning and not an error because the values themselves exported in full. Only the editing convenience is missing.
Next steps
- Google Sheets setup
Create a service account and share your sheet with it.
- Data Studio
Edit sheets in the editor, and see how an edit reaches the source.
- Registrations and build checks
What a reflect registers, and what a build checks.
- Sources and workbooks
The complete list of Google and xlsx limits.