add: AppendOrUpdateRowAction — upsert a row by key column value - #7
Merged
Merged
Conversation
…dex conversion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fetches all rows, updates in-place if the key value is found, otherwise appends. Returns "updated"/"appended" outcomes so workflows can branch on which path ran. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s, key column derivation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pend-or-update-row
…path failures in AppendOrUpdateRowAction The key value is derived by indexing into Columns at KeyColumn's position rather than a separate field. If KeyColumn pointed past the end of Columns (e.g. keying on column C while only supplying 2 column values), the derived key silently defaulted to empty string and would exact-match — and overwrite — the first row with a blank cell in that column. This is easier to hit than the equivalent gap in Update/Delete since it's driven by static settings rather than a runtime-bound value, so validate it explicitly. Also add missing failure-path tests for both write branches (the PUT update and the POST append) — only the initial GET's failure path was tested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AppendOrUpdateRowAction(googleSheets.appendOrUpdateRow) — an upsert that updates an existing row if the key column value is found, or appends a new row if not:append(not found)Columns[keyColumnIndex]— no separate "key value" field, avoiding redundant inputRowNumber,UpdatedRange,UpdatedRows,UpdatedCellsTest plan
dotnet test— all AppendOrUpdate tests passappendedupdatedColumnslist (not a separate field) — change it inColumnsand confirm the lookup uses the new valueSuggested automation workflow
Content publish log — Every time a content node is published in Umbraco, upsert a row keyed on the node ID into a "Published Pages" sheet. The first publish appends a new row; subsequent publishes update the "Last Published" date in place — no duplicates.
🤖 Generated with Claude Code