Skip to main content
Question

Zapier Error: Maximum call stack size exceeded in Google Sheets lookup step

  • December 24, 2024
  • 1 reply
  • 67 views

Hi Zapier Community,

I’m currently experiencing an issue with a Zap I created, and I need some guidance to fix it. Here’s what my Zap is supposed to do:

  1. When a new record is created in Airtable,
  2. It finds a specific Google Sheets file in Google Drive,
  3. Looks up a row in the Google Sheets file based on a Reference #,
  4. Updates the record in Airtable with the matching data from Google Sheets,
  5. Optionally creates or updates a contact in OpenPhone.

The Zap worked initially, but my master Google Sheets file has grown too large apparently, and now the Zap fails at Step 3 ("Lookup Spreadsheet Row"). The error code is “maximum call stack size exceeded”. I believe this is because the file size and number of rows are overwhelming Zapier.

I’ve brainstormed a few ideas, like splitting the Google Sheets file or optimizing the lookup process, but I’m not sure the best way to proceed. Specifically, I’d like to know:

  1. Is there a way to handle large Google Sheets files in Zapier without splitting them? 
  2. What are best practices for efficiently looking up rows in a Google Sheets file with 100,000+ rows with 6 columns of data?
  3. Is there a way to dynamically reference smaller Google Sheets files split by criteria (e.g., by date or year)?

I’d love to hear your advice or see examples of how others have managed similar workflows!

Thanks in advance for your help!

Did this topic help you find an answer to your question?

1 reply

PatriciaF
  • Zapier Staff
  • 6 replies
  • December 25, 2024

 

Hi there! ​@hg305  👋

 

Welcome to the Zapier Community, and thanks for sharing such a detailed breakdown of your workflow. Let’s dive in and see how we can tackle this together. 😊

It sounds like the size of your Google Sheets file is causing the issue. Google Drive has a limit of 5 million cells for spreadsheets created in or converted to Google Sheets. If your file is close to or exceeding this limit, that could explain why the "Lookup Spreadsheet Row" step is failing. Here are a few suggestions to get things back on track:

 

Reduce the number of cells in your spreadsheet

  • Even blank rows and columns count towards the cell limit! Try deleting unused rows and columns in all the worksheets within the file. This will free up space and may resolve the issue.
  • For step-by-step instructions, check out Google’s support doc.

 

Consider breaking your master spreadsheet into smaller files

  • You can break your master spreadsheet into chunks of 5 years, with each chunk as a separate worksheet (tab) within the same spreadsheet. This keeps everything organized while staying within Google Sheets' limits.
  • To make this work seamlessly, add a Path step in your Zap. This filter can branch the workflow based on the year or date criteria, dynamically deciding which worksheet to search for the data. This approach ensures the Zap only queries the relevant tab, improving efficiency and avoiding performance bottlenecks.

 

If you decide to create a new, smaller spreadsheet, don’t forget to update your Zap to point to the new file. Otherwise, the lookup step will continue referencing the old one.

 

Let me know if this feels right or needs more tweaking!