{
  "id": "7ijhwXKPf6M2ZUBM",
  "name": "Convert Addresses to LatLong with Google Sheets and Google Maps API",
  "tags": [],
  "nodes": [
    {
      "id": "9465735e-5d1d-4c93-b407-13ef79144f92",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -340,
        20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4041b7fa-c47e-44c2-b296-2913e8551c61",
      "name": "Using Google Map API to Return Lat Long Back",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        200,
        -40
      ],
      "parameters": {
        "url": "https://maps.googleapis.com/maps/api/place/textsearch/json",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $json.Address }}"
            },
            {
              "name": "key",
              "value": "AIzaYOUR_GOOGLE_API_KEY_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "20b26d33-2e4a-43ad-bc0f-bc510f02dbd0",
      "name": "Update Lat-Long in Each Places",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        540,
        -40
      ],
      "parameters": {
        "columns": {
          "value": {
            "Latlong": "={{ $json.results[0].geometry.location.lat }},{{ $json.results[0].geometry.location.lng }}",
            "row_number": "={{ $('Extract The Places from Google Sheet').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Latlong",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Latlong",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1738976351,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15Fz57qiARIJ6R5OzBAVgiAHnU8sOSX8eYFEP6thOrMM/edit#gid=1738976351",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "15Fz57qiARIJ6R5OzBAVgiAHnU8sOSX8eYFEP6thOrMM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15Fz57qiARIJ6R5OzBAVgiAHnU8sOSX8eYFEP6thOrMM/edit?usp=drivesdk",
          "cachedResultName": "Latlong Testing"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "29f53c52-0cb3-44ae-85ad-a9f2cded8334",
      "name": "Extract The Places from Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -120,
        -20
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1738976351,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15Fz57qiARIJ6R5OzBAVgiAHnU8sOSX8eYFEP6thOrMM/edit#gid=1738976351",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "15Fz57qiARIJ6R5OzBAVgiAHnU8sOSX8eYFEP6thOrMM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15Fz57qiARIJ6R5OzBAVgiAHnU8sOSX8eYFEP6thOrMM/edit?usp=drivesdk",
          "cachedResultName": "Latlong Testing"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dad3affe-47d9-475e-bd8a-cf4a81eb0fde",
  "connections": {
    "Update Lat-Long in Each Places": {
      "main": [
        []
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Extract The Places from Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract The Places from Google Sheet": {
      "main": [
        [
          {
            "node": "Using Google Map API to Return Lat Long Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Using Google Map API to Return Lat Long Back": {
      "main": [
        [
          {
            "node": "Update Lat-Long in Each Places",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}