8
n8n 中文网amn8n.com

在Google Sheets中使用自定义透视表和VLOOKUP聚合营销支出数据

中级

这是一个Document Extraction, Multimodal AI领域的自动化工作流,包含 10 个节点。主要使用 Merge, Summarize, GoogleSheets, ManualTrigger 等节点。 在Google Sheets中使用自定义透视表和VLOOKUP聚合营销支出数据

前置要求
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "5432b2ed-adde-4021-b6b3-e75e43bd102c",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1744,
        4816
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "20d77255-29ba-45aa-af1b-ff2b8ba91ef6",
      "name": "清空表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -240,
        4944
      ],
      "parameters": {
        "operation": "clear",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1235077339,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit#gid=1235077339",
          "cachedResultName": "render pivot"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit?usp=drivesdk",
          "cachedResultName": "Pivot Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "43298259-36ab-403d-91f8-0d0a499b6daf",
      "name": "数据透视",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -464,
        5040
      ],
      "parameters": {
        "options": {},
        "fieldsToSplitBy": "Name",
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Spend ($)",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "ea502cf7-be4a-41ac-a1e0-38f73398c95e",
      "name": "获取营销数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1008,
        4944
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit#gid=0",
          "cachedResultName": "data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit?usp=drivesdk",
          "cachedResultName": "Pivot Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "896e5698-f99a-4e1b-ad4c-f5c4c07e847e",
      "name": "Vlookup 数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1280,
        5408
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 894339285,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit#gid=894339285",
          "cachedResultName": "Lookup"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit?usp=drivesdk",
          "cachedResultName": "Pivot Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "4178ff0a-9cbb-4eef-93d8-2a012471f0ed",
      "name": "合并表格(Vlookup)",
      "type": "n8n-nodes-base.merge",
      "position": [
        -688,
        5040
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "fieldsToMatchString": "Channel"
      },
      "typeVersion": 3.2
    },
    {
      "id": "3e622961-1081-40cd-870e-c3b0d114d3c0",
      "name": "创建“数据透视表”类功能",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -224,
        5152
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "sum_Spend_($)",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "sum_Spend_($)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1235077339,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit#gid=1235077339",
          "cachedResultName": "render pivot"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aO6fhd-P55lXy9QuKs23Eifi1SzZ2GAFj0q0Qx4vl30/edit?usp=drivesdk",
          "cachedResultName": "Pivot Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c007458e-07ec-4b25-b898-272ce0fcde8f",
      "name": "便签55",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        4608
      ],
      "parameters": {
        "color": 7,
        "width": 2144,
        "height": 1056,
        "content": "### 使用 n8n 在 Google Sheets 中构建数据透视式营销支出摘要(合并 + 汇总 + Vlookup)"
      },
      "typeVersion": 1
    },
    {
      "id": "d004d740-9e2d-409a-b5df-960bd28482a7",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2240,
        4608
      ],
      "parameters": {
        "width": 400,
        "height": 1056,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "2694e9b7-3405-4139-99bc-5ffd735f33a8",
      "name": "Sticky Note65",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        4880
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 656,
        "content": "### 1) 连接 Google Sheets(OAuth2)"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Pivot": {
      "main": [
        [
          {
            "node": "Clear sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create \"Pivot Table\" Kindof",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Vlookup Data": {
      "main": [
        [
          {
            "node": "Merge Tables (Vlookup)",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Marketing Data": {
      "main": [
        [
          {
            "node": "Merge Tables (Vlookup)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Tables (Vlookup)": {
      "main": [
        [
          {
            "node": "Pivot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get Marketing Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Vlookup Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 文档提取, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量10
分类2
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部链接
在 n8n.io 查看

分享此工作流