# Google Sheets action - Update row
# How it works
This action allows you to update a row in a sheet. It is often used together with action Search rows, so you will first search for the rows you want then update them.
# How to use it
The following example will demonstrate how to use the
Update row action in conjunction with
Our sample sheet is a list of items from different countries. For Google Sheets connector to work, the sheet needs to have at least 1 header row and 1 data row.
We realise there is an error in rows 3 & 4:
Region of "Australia" should be "Australia and Oceania", not "Asia". Let's use the following Workato recipe to correct that. It will search for rows with
Country = "Australia" and
Region = "Asia", then update the
Region to "Australia and Oceania" instead.
This is how we setup the Search & Update actions:
Step 1 - Search rows: We set
Region= "Asia" and
Country= "Australia". The action will search for rows matching those conditions.
Step 2 - Repeat action: Loop through the rows from
Search rowsresult, using the
Step 3 - Update row: Use
Row numberdata pill from the the
Foreachloop to tell the action which row to update. We set the new
Regionvalue to "Australia and Oceania".
After we run the recipe, rows 3 & 4 are correctly updated:
|Spreadsheet||You can either select a spreadsheet from the dropdown, or use |
|Sheet||You can either select a sheet from the dropdown, or use |
|Row number||Indicate which row you want to update.|
After you select a spreadsheet, a sheet and a row in the sheet, the columns in that row will be displayed here. Enter the new values for Workato to update those columns.
For example, in the screenshot above, Workato will update the selected row with new values:
|Spreadsheet ID||ID of the spreadsheet. You can map this into |
|Spreadsheet name||Name of the spreadsheet.|
|Sheet name||Name of the sheet. You can map this into |
|Updated range||The range in the sheet that this action have updated.|
|Updated columns count||The number of columns this action has updated.|
This contains the values of all updated columns in the selected row.