Best answer

Add OR update row in Google sheets

  • 30 September 2022
  • 8 replies
  • 81 views

Userlevel 1

Hi

I want to start zapping partial entries from Gravity Forms. The issue is that by definition, partial entries creates multiple entries for a given form. So I’m wondering if Zapier can update a row when it finds the same email, OR add a row if the email field is unique.

Thanks

icon

Best answer by Danvers 18 October 2022, 17:24

View original

8 replies

Userlevel 7
Badge +8

Hi @cb2022 , 

 

This is definitely doable using a Lookup Row in Google Sheets step and Paths by Zapier :) 

What you need to do is the following: 

 

  1. After the form submission (which should be the trigger) add an Action that is Lookup Row in Google Sheets by searching in the Emails field. Dont forget to set the “Should this step be considered a "success" when nothing is found?” to “Yes”
  2. Create a Paths by Zapier where the condition would be “zap success = true” and another one for “zap success = false” 
  3. Now you have 2 paths, one where you have an entry for this email address (the action in this path would be to update the google sheets row) and another path where there is no email address available in the google sheet so the action would be Create new row 

let me know if this works for you :) 

Userlevel 1

Thanks for the quick response. Sounds promising. Will give it a try next week and report back

Userlevel 4
Badge +7

Hi there @cb2022 - checkin in to see how you got along with @MohSwellam’s suggestion? Would love to hear if it worked for you or if there is anything else we can do to help you!

Looking forward to hearing back- 

Rachael

Userlevel 1

Thanks for checking in. I have not had the opportunity to try it yet. I’ll be sure to report back when I have

Userlevel 7
Badge +12

Hi there @cb2022!

I can see that @MohSwellam has given you a great way of using Paths to add conditional logic into your Zap, but there is an easier way to do what you need in this particular case. 

I’ll explain it in more detail, but to give you an overview, you need to use the following steps in your Zap:

  1. Gravity Forms - Form Submission
  2. Google Sheets - Lookup Spreadsheet Row
  3. Google Sheets - Update Row

The Lookup Spreadsheet Row will either find an existing row or, if one doesn’t exist, it will create one. The Update Row step will update the Row that was just found (or created) in the previous step. This option will be better for you if your Zapier plan isn’t Professional or higher as you can’t use Paths with a starter plan. It also uses less tasks than adding Paths. 

 

Here’s how to set up those actions in your Zap

  • Add a Lookup Spreadsheet Row to your Zap after the trigger
  • At the bottom of the step you’ll see a tickbox that says Create Google Sheets Spreadsheet Row if it doesn’t exist yet? Select that checkbox
  • The editor will bring up fields for each of the columns, map any information from the questionnaire that you’d like in the new row
  • At the bottom, you’ll get a prompt asking you if you want to remove the extra field, that’s because the step no longer needs to know if finding a row constitutes a success. Click Remove these fields

 

  • After the Lookup Spreadsheet Row step, add an Update Spreadsheet Row action 
  • In the Row field, choose Custom and select the ID field from the Lookup Spreadsheet Row step 
  • This action will update the row that was previously found or created in the previous step. 

I hope that’s clear, let us know if you have any questions!

Userlevel 1

Thank you both for your detailed replies.

@MohSwellam I got stuck at step 2 because when I try to edit the path, I’m not clear on where I choose the TRUE and FALSE you referenced. I assumed “Only continue if...Zap Data was Found = True”, but then what is the Condition?

I see what you are saying in step 3 to update if true, or create if false but cant get past #2

 

@Danvers I followed your suggestion till the end and while the partials rows are being created, they are not getting updated with new fields. When I test the action I get this:

Any suggestions?

 

Userlevel 2
Badge +5

Hi @cb2022, hope you’re doing well!

 

With regards to the error on the screenshot, this happens when the Update Spreadsheet Row step is not getting the Row ID that is needed to do the update. Based on the error, I believe that an email field was mapped instead of the Row ID.

To fix this, remap the Row field from the Lookup Spreadsheet Row step onto the Row field on the Update Spreadsheet Row step to match the requirement. Please refer to this help doc for more details on setting up the Updated Spreadsheet Row step: https://help.zapier.com/hc/en-us/articles/8495978803213-Finding-and-Updating-Rows-in-Google-Sheets#update-the-row-0-3

 

Please give that a try and let me know if you run into issues.

Userlevel 1

Thank @Paolo. That was the issue. I misunderstood @Danvers last instruction

Reply