Skip to guide content
All guides

Integrations

Connect a Google Sheet to your leads

Send new form responses and existing sheet rows to YatraHQ with the supplied Apps Script.

8 minute readReviewed 8 October 2026

Who can use this: Workspace administrators; Google Sheet editor access required

Open this workflow
Conceptual illustration of spreadsheet, CRM, messaging, and archive workflows.
Original workflow illustration · conceptual, not an app screenshot.
YatraHQ · Connect a Google Sheet to your leadsReal app screenshot
Connect a Google Sheet to your leads: current YatraHQ controls, cropped to exclude customer records.
  1. 1. Open Google Sheets
  2. 2. Rotate the existing key
Open full-resolution image ↗
On this page

Prepare the sheet

Use a Google spreadsheet that you can edit. Each lead tab needs recognisable headers, including a usable phone/contact column. Name, city, destination, travellers, budget, and date columns help enrich enquiries. Phone-only rows can be imported; review their details later. Hidden tabs are skipped.

Install the script

  1. 1Open YatraHQ Settings → Google Sheets. Select Turn on sync, or Make a new key if replacing an existing script.
  2. 2Copy the generated script. It contains the workspace key, which is shown only when created.
  3. 3Open the Google Sheet → Extensions → Apps Script. Paste the supplied script into the project and save. Preserve unrelated code if this sheet already has scripts.
  4. 4Select setup from the function selector, run it, review the requested Google permissions, and authorise the script.
  5. 5Return to the sheet and check the YatraHQ status column on each lead tab. Verify a synced lead in the CRM.

Visual guide · Workflow

How a Sheet row reaches the CRM

Keep Google setup, row processing, and CRM verification separate.

  1. Prepare the Sheet

    Check visible tabs, contact headers, phones, and original dates.

  2. Set up Apps Script

    Use the supplied script and workspace key; run setup and authorise it.

  3. Run sync

    The timer runs every five minutes; a form trigger is attempted where supported.

  4. Inspect the row result

    Read Synced, Updated, Duplicate, or Skipped before deciding what to retry.

  5. Verify in CRM

    Search a representative enquiry and check workspace, source, and dates.

Remember: A completed script execution is not proof that every row created a new lead. Keep the workspace key private.
YatraHQ · Start from the sample sheet formatReal app screenshot
Start from the sample sheet format: current YatraHQ controls, cropped to exclude customer records.

Actual Google Sheets settings component captured before enabling sync. No key was generated.

Locate this workflow using the page title and controls.Open full-resolution image ↗

Understand ongoing sync

Setup performs an initial sync and installs a five-minute trigger. Form responses also use a form-submit trigger when available. Timed/manual sync sweeps the supported tabs; a form event uses its own tab. Large backfills run in slices and continue on later runs. Rows with a status are not resent automatically.

Review dates and duplicates

Recognised original lead dates help preserve historical reporting. Check dates and the workspace timezone after a backfill. Duplicate handling considers the normalised phone and trip interest, so the same person may have distinct enquiries for different trips. Read Synced, Duplicate, or Skipped results before assuming every row became a new lead.

Worked example · fictional people and illustrative amounts

Worked example: backfill several tour tabs without losing history

An agency has separate sheet tabs for Kashmir, Kedarnath, and general enquiries. Some rows contain only a contact number, city, destination, and an original enquiry date. The goal is to bring useful enquiries into the CRM while preserving their trip context and history, then continue receiving new rows. It is not to turn every old contact into a newly created enquiry dated today.

Start with one small tab and a few representative rows. Check headers, phone values, original dates, and whether the same person appears for more than one trip. Keep the sheet timezone and workspace reporting timezone in mind. The tab name is recorded as context through the sync workflow, but it does not replace checking the actual destination or package information.

  1. 1Confirm that you can edit the Google spreadsheet and that the intended lead tabs are visible. The script skips hidden tabs.
  2. 2Generate or rotate the workspace key in YatraHQ and copy the supplied script. Rotation invalidates the old key; update every script that was using it.
  3. 3Open Extensions → Apps Script, paste and save the script, choose setup, and authorise the required Google services after reviewing the permissions.
  4. 4Inspect the result for a few rows and open the matching CRM enquiries. Check the original creation dates, normalised phone, city, destination, group information, and notes before allowing a large backfill to continue.
  5. 5Review subsequent timer executions and the YatraHQ status column. Large histories can continue in slices rather than finishing in a single run.
YatraHQ · Open Apps Script from the actual Sheet menuReal app screenshot
Open Apps Script from the actual Sheet menu: current YatraHQ controls, cropped to exclude customer records.

Google Sheets Extensions menu captured without spreadsheet contact rows.

  1. 1. Open Apps Script
Open full-resolution image ↗

Read each row result before deciding what to retry

A status is also a processing marker. Ordinary sync skips rows that already have one. Do not repeatedly clear the entire status column simply because the total CRM lead count differs from the sheet row count. Some rows may be duplicates, updates, invalid contacts, or a separate trip for the same person.

Read each row result before deciding what to retry
Sheet resultMeaningNext check
SyncedA new lead was createdVerify workspace, trip context, and original date
UpdatedA matched lead was enriched with missing informationInspect the existing CRM record rather than search for a second new lead
DuplicateA matching enquiry was found without a new record being neededReview phone and trip context
Skipped: reasonThe row was not acceptedCorrect the stated row issue before retrying

Visual guide · Key distinctions

Read the row status as a decision guide

Different outcomes require different checks.

  1. Synced

    A new enquiry was created. Verify the saved lead.

  2. Updated

    A match was enriched. Inspect the existing lead.

  3. Duplicate

    A match was found without a new record being needed. Check phone and trip context.

  4. Skipped: reason

    The row was not accepted. Correct the stated issue before retrying.

Remember: Ordinary sync skips processed statuses. resyncAll deliberately revisits rows; review a sample before reprocessing a large history.
YatraHQ · Verify the imported enquiry in the CRMReal app screenshot
Verify the imported enquiry in the CRM: current YatraHQ controls, cropped to exclude customer records.

Use lead search and filters to check representative rows; customer records are excluded from this crop.

  1. 1. Add an enquiry
  2. 2. Import lead rows
  3. 3. Choose a pipeline view
Open full-resolution image ↗

Solve editor access and setup problems in the right order

If Apps Script opens a login loop or Google Drive error, solve account access before editing the YatraHQ code. Google documents issues with multiple signed-in accounts. Try a private window with only the account that owns or can edit the sheet. If the organisation blocks Apps Script, its administrator needs to review that restriction; a CRM key change will not fix a Google account policy.

After the editor opens, save the project and manually run setup once so the authorisation prompt can be shown. The script creates the five-minute trigger and attempts a form-submit trigger. A form-trigger error is caught so timed sync can continue. Review the execution log and installed triggers rather than assuming that one error means nothing is running.

Use syncNewLeads for an ordinary manual sync. The current script also provides resyncAll, which clears the processing statuses and revisits rows. Treat that as a deliberate reprocessing operation after reviewing the reason, the current script version, and a small test sample. It is not the first response to every discrepancy, and the matching/enrichment result still needs verification.

Visual guide · Workflow

Find the failure before retrying

Start at the first point where the expected evidence disappears.

  1. Access

    Can the right account open the service and intended workspace?

  2. Connection

    Is the integration active and linked to that workspace?

  3. Record

    Is this exact enquiry mapped, with usable contact and trip information?

  4. Delivery result

    Inspect the latest error and the result after a relevant retry.

Remember: Changing a CRM key will not fix a Google login policy. A generic retry will not explain a wrong workspace or unmapped enquiry.

Prepare historical dates and source information

Original enquiry dates affect the creation-date cohort in Intelligence. A recognised Date column can be interpreted as the lead date rather than a travel preference; review a sample to make sure the meaning is correct. Invalid, impossible, or future original dates should be investigated instead of silently treated as reliable history.

Source labels also affect reporting. The integration maps recognised workspace source labels and values, with a fallback when a source is not mapped. A destination tab or imported phone is not evidence that the enquiry came from Meta. Record the actual channel when it is known and avoid using a paid-ad source merely to make the reporting totals look complete.

YatraHQ · Review trip details after a phone-only importReal app screenshot
Review trip details after a phone-only import: current YatraHQ controls, cropped to exclude customer records.

Actual lead form with fictional values shows the information a team should confirm after an incomplete sheet row.

  1. 1. Confirm the budget
  2. 2. Record preferred travel dates
Open full-resolution image ↗

Backfill verification checklist

  • One representative sample was checked before a large history was processed.
  • Visible tabs have usable contact headers and phone values.
  • Original dates and timezone interpretation are correct.
  • Synced, Updated, Duplicate, and Skipped results are understood rather than counted as identical outcomes.
  • New rows are arriving through the expected timer or form trigger.
  • The current key and script are kept private, and rotation is coordinated across every connected sheet.

Check your result

The sheet shows row results, the expected enquiries appear in the right workspace, and Settings reports recent sync activity.

Troubleshooting

Apps Script opens an error or login loop

Google documents issues with multiple signed-in accounts. Try a private browser window signed in only with the sheet’s editor/owner account, then reopen Extensions → Apps Script. If access is denied by your organisation, ask its Google Workspace administrator.

Setup reports a form-trigger error

The supplied script catches that error and continues with five-minute sync. Read the execution log and verify the timer exists before expecting instant form delivery.

New rows are not arriving

Check script execution errors, the current workspace key, visible lead tabs, usable headers/phone values, row statuses, and the five-minute trigger. Rotated keys require a new script.

Continue with these guides