L2 Hub
Google
gsheets
Update Sheet Names

L2 Construct: update_sheet_names

sheets google

Description

UpdateSheetNames changes the names of sheets within a Google Spreadsheet.

This handler takes the following input:

  • spreadsheet_id: The ID of the Google Sheets spreadsheet
  • old_sheet_names: The names of the sheets within the spreadsheet to replace
  • new_sheet_names: The names of the sheets within the spreadsheet to replace the old names with

It returns:

  • spreadsheet_id: The ID of the spreadsheet (same as input)
  • spreadsheet_url: The URL to access the spreadsheet

L2 Data

  1. Provider: google
  2. Module: gsheets
  3. Action: update_sheet_names

Example Step

{
  "name": "insert-your-step-name",
  "type": "l2",
  "l2_data": {
    "provider": "google",
    "module": "gsheets",
    "action": "update_sheet_names",
    "metadata": {}
  }
}
 

Input

Example

{
  "spreadsheet_id": "1234567890",
  "old_sheet_names": ["Sheet1"],
  "new_sheet_names": ["Sheet2"]
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/google/gsheets/update-sheet-names-input",
  "$ref": "#/$defs/UpdateSheetNamesInput",
  "$defs": {
    "UpdateSheetNamesInput": {
      "properties": {
        "spreadsheet_id": {
          "type": "string"
        },
        "old_sheet_names": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "new_sheet_names": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["spreadsheet_id", "old_sheet_names", "new_sheet_names"]
    }
  }
}
 

Output

Example

{
  "spreadsheet_id": "1234567890",
  "spreadsheet_url": "https://docs.google.com/spreadsheets/d/1234567890",
  "error": {
    "is_error": false
  }
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/google/gsheets/update-sheet-names-output",
  "$ref": "#/$defs/UpdateSheetNamesOutput",
  "$defs": {
    "HandlerError": {
      "properties": {
        "is_error": {
          "type": "boolean"
        },
        "errors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["is_error"]
    },
    "UpdateSheetNamesOutput": {
      "properties": {
        "spreadsheet_id": {
          "type": "string"
        },
        "spreadsheet_url": {
          "type": "string"
        },
        "error": {
          "$ref": "#/$defs/HandlerError"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["spreadsheet_id", "spreadsheet_url", "error"]
    }
  }
}