Google Sheet Cells
Google Sheet Cells is a component that lets you add, update, delete, or read rows in a Google Spreadsheet directly from your Nappai dashboard. It works with the Google Sheets API, so you can automate data entry, keep your sheets up‑to‑date, or pull data into other parts of your workflow.
How it Works
When you use this component, Nappai connects to Google Sheets through a credential you set up in the Credentials section. The component sends the chosen operation (Add, Update, Delete, or Get) to the Google Sheets API, passing along any data you provide. The API then performs the action on the specified spreadsheet and sheet, and the component returns the result as one of its outputs.
If you enable Mapping Mode, the component can process many rows at once. Instead of entering a single value, you can feed a list of records, and the component will loop through them, applying the same operation to each.
Operations
This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:
- Add Row: Adds a new row to the selected sheet.
- Update Row: Updates an existing row with new values.
- Delete Row: Removes a row from the sheet.
- Get Rows: Retrieves rows from the sheet.
To use the component, first select the operation you need in the Operation field.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called Mapping Data is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
-
Select Spreadsheet: Choose the Google Spreadsheet file. If Spreadsheet ID is provided, this field will be ignored.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Values: Provide the data for the row. Each column is a key and the value is the text to be added to the row.
- Visible in: Add Row, Update Row
-
Operation: Choose the operation to perform.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Column Recognition: Choose Automatic to let the component detect column names from the sheet, or User Defined to provide them manually.
- Visible in: Add Row, Update Row
-
First row: Specify the first row number to start from.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Hoja actual: Current sheet name (used internally by the component).
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Declare Headers: Indicate that the first item of a column is a header of the table.
- Visible in: Get Rows
-
Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Mode of Input: Choose how to provide input: By Id, By Selection, or By Url.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Range: Specify the cell range to use. If left empty, the entire sheet is used by default. Adding a value will place it in the next available cell after the last existing entry. Format:
InitialColumnLetterRowNumber:FinalColumnLetterRowNumber
Example:A1:B10
.- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Row Number: Row number to update or delete. In delete operations cannot be 1 because headers cannot be deleted.
- Visible in: Update Row, Delete Row
-
Select Sheet: Choose the sheet within the spreadsheet to use.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Spreadsheet ID: Provide the spreadsheet ID. If File is selected, this field will be ignored.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Tool Name: Name of the tool when used as a tool.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Tool Description: Description of the tool.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
-
Tools arguments metadata: Defines the arguments metadata for the tools.
- Visible in: Add Row, Update Row, Delete Row, Get Rows
Outputs
- Data: The raw data returned from the operation (used by other components).
- Json: A JSON string representation of the data (useful for logging or passing to other services).
- Tool: A tool object that can be used by Nappai agents when this component is connected as a tool.
Usage Example
Adding a row to a spreadsheet
- Drag the Google Sheet Cells component onto the canvas.
- In the Operation field, select Add Row.
- Choose the spreadsheet with Select Spreadsheet or paste its ID in Spreadsheet ID.
- Pick the sheet with Select Sheet.
- In Values, enter a JSON object such as:
{"Name": "Alice","Email": "alice@example.com","Role": "Admin"}
- (Optional) Enable Mapping Mode if you want to add many rows at once.
- Click Run.
The component will add the row and output the new row data in Data and a JSON string in Json.
Related Components
- Google Sheets API Credential – Set up the credential needed for this component.
- Google Sheets Query – Retrieve data with custom queries.
- Data Formatter – Transform data before sending it to Google Sheets.
Tips and Best Practices
- Use Mapping Mode when you need to add or update many rows at once; it saves time and reduces API calls.
- Keep the Spreadsheet ID handy; you can copy it from the URL of the sheet.
- If you only need to read data, choose Get Rows and set Declare Headers to true to get a clean table.
- When deleting rows, avoid setting Row Number to 1 to protect your header row.
- Store your Google Sheets API credentials securely in Nappai’s Credentials section and never share them.
Security Considerations
- The component uses a Google Sheets API credential that must be configured in Nappai’s Credentials area.
- Only users with access to the credential can run this component.
- Data sent to Google Sheets is transmitted over HTTPS, ensuring encryption in transit.
- Be mindful of the data you write to public or shared spreadsheets; sensitive information should be stored in protected sheets.