Problem and Error Message
I cannot access a particular cell in Google Sheets. Suppose I want to access the cell B3 (it does not have a title therefore I can’t use the Google Sheets node), Im trying to make an api PUT call to the google sheet services but I always get the 400 error.
Workflow
{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
0,
0
],
“id”: “49442ab6-2cc4-46f3-8edf-b7c86ebe6f12”,
“name”: “When clicking ‘Execute workflow’”
},
{
“parameters”: {
“documentId”: {
“__rl”: true,
“value”: “1Oq8QgWks__k8EnR0ImiRnQ8X8lmWl3Edsmnv0bHo5f4”,
“mode”: “list”,
“cachedResultName”: “Prueba N8N”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1Oq8QgWks__k8EnR0ImiRnQ8X8lmWl3Edsmnv0bHo5f4/edit?usp=drivesdk”
},
“sheetName”: {
“__rl”: true,
“value”: “gid=0”,
“mode”: “list”,
“cachedResultName”: “Hoja 1”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1Oq8QgWks__k8EnR0ImiRnQ8X8lmWl3Edsmnv0bHo5f4/edit#gid=0”
},
“filtersUI”: {
“values”:
},
“options”: {}
},
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 4.7,
“position”: [
208,
0
],
“id”: “db805276-2572-4ca5-bb9b-6b55c4ec91e4”,
“name”: “Get row(s) in sheet”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “mPdeJzQl3gXvz8y8”,
“name”: “Google Sheets account”
}
}
},
{
“parameters”: {
“jsCode”: “// Leer el valor del nodo anterior (Google Sheets)\nconst productName = $input.first().json[“nombre_producto”];\n\nconst SPREADSHEET_ID = “100KzIm8yC_XMtWwjSpxyf77i-c5YApHfgBG-KAdUuzw”;\nconst SHEET_NAME = “Sheet2”;\nconst CELL = “C5”;\n\n// Escapar el nombre de la hoja para la URL\nconst rangeUnescaped =${SHEET_NAME}!${CELL};\nconst rangeEscaped = encodeURIComponent(rangeUnescaped);\n\nreturn {\n json: {\n spreadsheetId: SPREADSHEET_ID,\n range: rangeUnescaped,\n rangeEscaped: rangeEscaped,\n productName: productName,\n valueInputOption: “USER_ENTERED”\n }\n};”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
416,
0
],
“id”: “eb1b2334-e69f-4cfa-9bd5-3d1aaa53e308”,
“name”: “Code in JavaScript”
},
{
“parameters”: {
“method”: “PUT”,
“url”: “=https://sheets.googleapis.com/v4/spreadsheets/{{$json.spreadsheetId}}/values/{{$json.rangeEscaped}}”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “googleSheetsOAuth2Api”,
“sendQuery”: true,
“queryParameters”: {
“parameters”: [
{
“name”: “valueInputOption”,
“value”: “={{$json.valueInputOption}}”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “range”,
“value”: “={{ $json.range }}”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.4,
“position”: [
624,
0
],
“id”: “5b7b62de-60b9-445d-9ce4-1f86026b4522”,
“name”: “HTTP Request”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “mPdeJzQl3gXvz8y8”,
“name”: “Google Sheets account”
},
“googleOAuth2Api”: {
“id”: “tPyIQ2oPHyPQpVLt”,
“name”: “Google account”
},
“httpBearerAuth”: {
“id”: “gyieKrDlXkIBhP83”,
“name”: “Bearer Auth account”
}
}
}
],
“connections”: {
“When clicking ‘Execute workflow’”: {
“main”: [
[
{
“node”: “Get row(s) in sheet”,
“type”: “main”,
“index”: 0
}
]
]
},
“Get row(s) in sheet”: {
“main”: [
[
{
“node”: “Code in JavaScript”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code in JavaScript”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “0b6c66b4ec7d77f1bc1431e9bf09ce056d60b6594616ddd664cd3a2596eacd8b”
}
}
Output returned by the last node
Bad request - please check your parameters
Unable to parse range: Sheet2!C5
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main): own
- Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
- Operating system: MacOS








