Skip to main content
Question

When creating a new row in Google Sheets, how do I get it to add the next number in a sequence in a specific column?

  • 11 January 2022
  • 4 replies
  • 1165 views

When creating a new row in Google Sheets, how do I get it to add the next number in a sequence in a specific column?

 

When a new order comes through from Shopify I need to add it to a Google Sheet as we have to send a sales report CSV every day to our regulatory body

 

One of the details we need to send is a Service ID number

 

Basically, what I want to do is give a customer the next number on the list (i.e. if they buy 1 product they get the next number, and if they buy 4 products they get the next 4 numbers)

 

How do I get the Zap (or a setting natively within google sheets) to add the next number in a column when a new row is added (i.e. 002 after 001 etc.)

 

I’m assuming I need to do this in a create row zap and not an update row zap, as I can’t see how an update row zap would do it dynamically (i.e. update the next row)

 

Also, is Google Sheets even the right product to be doing this in?  Should I be using something like Airtable for example?

 

Hope that makes sense

 

Thanks

RJSP

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 6
Badge +6

Hey @rjsp ,

 

Did you try using below action of Storage by Zapier ?

 

https://zapier.com/apps/storage/integrations

No.  How / Why would this work?

 

Thanks

 

RJSP

Userlevel 6
Badge +6

Hey @rjsp ,

 

You can define the logic in your Zap with this action. Every time you receive order on Shopify, you can increase the value by 1.

 

You can read here - https://zapier.com/help/create/storage-and-digests/storage-examples-in-zaps

Userlevel 7
Badge +12

Airtable does make it significantly easier as they have a feature for auto increment. However, you can use google sheets formulas to determine the next row’s number based off of the previous row’s value.

You can use sheets Indirect() formula for it. 

Assuming you have the values in column A it would be something like
=Indirect("A"&Row()-1,True)+1