https://console.cloud.google.com/
Google Credentials Setup
• n8n Google Credentials Setup in 114 Second...
URL
https://sheets.googleapis.com/v4/spre...{{ $json.spreadsheetId }}:batchUpdate
JSON BODY
{
"requests": [
{
"duplicateSheet": {
"sourceSheetId": {{ $json.sourceSheetId }},
"newSheetName": "{{ $json.newSheetName }}"
}
}
]
}
ENTIRE WORKFLOW JSON
________________________________
{
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
0,
0
],
"id": "05b73c01-f6a0-404e-9133-f5809a03f791",
"name": "When clicking ‘Execute workflow’"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "b99447ca-92a2-4a00-8be2-a762a5e737c8",
"name": "spreadsheetId",
"value": "1uyyaMq2oS7NJ7uQCHDuKZYbkOHnxoImY0vBuFlT8_vU",
"type": "string"
},
{
"id": "edcd9e00-e741-48b7-843f-a18f39fbbc08",
"name": "sourceSheetId",
"value": "692096720",
"type": "string"
},
{
"id": "e81e7d42-718e-4de7-89c6-c0136484794e",
"name": "newSheetName",
"value": "={{ $now.format('yyyy-MM-dd').slice(0,7\n) }} test 2",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
220,
0
],
"id": "829fdce9-f70e-48da-ab73-685f0ac22f52",
"name": "Edit Fields"
},
{
"parameters": {
"method": "POST",
"url": "=https://sheets.googleapis.com/v4/spre...{{ $json.spreadsheetId }}:batchUpdate",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "googleOAuth2Api",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"requests\": [\n {\n \"duplicateSheet\": {\n \"sourceSheetId\": {{ $json.sourceSheetId }},\n \"newSheetName\": \"d{{ $json.newSheetName }}\"\n }\n }\n ]\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
440,
0
],
"id": "ef119c47-4514-4b89-9cb9-4d41f2575528",
"name": "HTTP Request",
"credentials": {
"googleOAuth2Api": {
"id": "TAUJIXdk5uPDEuus",
"name": "Google account - Sheets"
}
}
}
],
"connections": {
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "940d7633a2c319e04d0d9e3e58090ed05920d3b1ff7e9e4cc7c4d9e7a72ee94b"
}
}
n8n: https://n8n.partnerlinks.io/1q97sbubpqsi
#n8n #googleSheets
Информация по комментариям в разработке