Skip to main content
Roberty Studio
RPAGoogle Sheets

Protect range

Protect range

Protects a cell range against editing.


Options​

Google Sheets connection​

Select the Connection action set up in the flow.

Spreadsheet ID​

Enter the ID of the spreadsheet. The ID can be found in the spreadsheet URL: docs.google.com/spreadsheets/d/{spreadsheetId}/edit.

Tab name or ID​

Enter the tab name (e.g. Página1) or, using the number type, the numeric ID of the tab.

E-mails allowed to edit​

Enter the e-mails that will be allowed to edit the range even with the protection active (optional). Use the Add e-mail button to include more than one address.

Advanced options​

Start row​

Enter the number of the first row of the range (optional).

Last row​

Enter the number of the last row of the range (optional, included in the range).

Start column​

Enter the number of the first column of the range (optional, 1 matches column A).

Last column​

Enter the number of the last column of the range (optional, included in the range).

Protection description​

Enter a description to identify the protection created (optional).

Only show a warning​

Option to select Yes or No. When enabled, editing the range is not actually blocked — only a warning is shown to whoever tries to edit it. Default: No (blocks editing).

Returns​

Javascript code​

js
actions["action-id"].protectedRangeId // ID of the newly created range protection (Number)

Field selection​

  • protectedRangeId — ID of the newly created range protection (Number)

Rules and Conditions​

  • The Google Sheets connection, Spreadsheet ID and Tab name or ID fields are required.
  • The e-mails given in E-mails allowed to edit must be valid e-mail addresses.
  • With Only show a warning on, the E-mails allowed to edit are ignored: anyone with edit access to the spreadsheet can edit the range after confirming the warning.
  • When Start row, Last row, Start column and Last column are not given, the protection is applied to the whole tab.
  • If the Last row is lower than the Start row, or the Last column is lower than the Start column, the robot stops the run with an error.
  • If the Google API does not return the ID of the newly created protection, the robot stops with an error.