Google Sheets onEdit function not triggering when Zapier adds rows

I’m working with a Google Sheets document that gets new data from Zapier automation. I want to automatically fill in a specific column whenever Zapier creates a new row.

The weird thing is that my script works perfectly when I manually add rows or edit cells myself. But when Zapier does its thing and adds rows automatically, my onEdit function just doesn’t run at all.

Has anyone faced this issue before? What could be causing this and how can I fix it?

Here’s the code I’m using:

function onEdit(event) {
    var currentRow = event.range.getRow();
    SpreadsheetApp.getActiveSheet()
        .getRange(currentRow, 8).setValue('Updated_Value');
}

I really need this automation to work since I have hundreds of rows being added weekly through Zapier.

yeah, zapier’s a bit tricky like that. onEdit only catches user actions, so it won’t work for zapier added rows. you could try using onFormSubmit or maybe a timed trigger to regularly check for new data and fill the column you need.

Had this exact same issue last year! The problem is onEdit only fires when humans make changes - not when APIs or Zapier push data in. I switched to onChange triggers and that fixed it. You’ll need to set up an installable trigger instead of the simple one you’re probably using. Go to your script editor, hit the trigger menu, and manually add an onChange trigger. Then update your function since onChange events work differently - they don’t give you the same range info as onEdit. You’ll have to add logic to figure out which rows actually got added. I just tracked the last processed row number in a separate cell to catch new entries.

This is a well-known limitation with Google Sheets scripts. The onEdit function is designed to respond to manual changes made through the user interface, which is why it’s not triggered by Zapier. A potential workaround is to implement an onChange trigger, as it can detect changes made by external services like Zapier. Alternatively, you might consider using a time-driven trigger to regularly check for updates in your sheet and apply the necessary changes. I have found this approach to be more reliable for consistent updates.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.