• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

  • Due to Diwali and Bhai Dooj celebrations, our team will have limited availability. While we’ll continue to monitor threads, responses may be slightly delayed. Normal operations will resume on Friday, 24th October 2025.

Google Sheets - Add new Row - retrieve row number

erh

Member
I'm using the Google Sheets action "Add new row" -- is there a way to use a variable which represents the row number that was just added to?

Right now I have to do something rather complicated: =INDIRECT("AnotherSheet!A" & ROW())

This fetches the value in the sheet "AnotherSheet", in column "A", at the Row of the currently edited cell. Alas, the =INDIRECT function causes the entire spreadsheet to re-calculate, and is sort of janky.

Is there a variable available in the "Add new row" function that can represent the row being added to?

At the very least to allow later actions to use the Row# to retrieve data without requiring a "Lookup SPreadsheet Rows" action?
 

ArshilAhmad

Well-known member
Staff member
Hi @erh,

The 'Google Sheets: Add New Row' action step does provide you with the row in which the data has been added. You can extract it in the manner suggested below.
 
  • Like
Reactions: erh

erh

Member
Hi @erh,

The 'Google Sheets: Add New Row' action step does provide you with the row in which the data has been added. You can extract it in the manner suggested below.
Great idea. I think it can be even easier, actually, using Text Formatter: Extract Pattern

I was able to use this to extract the last digit: (\d+)$

This is an example string from your linked workflow:
Code:
2. Updates UpdatedRange : Sheet1!A19:D19

The result was 19.

Question, do you know for a fact that the Add New Row action's UpdatedRange return string's Last Row variable will always be the row that was just recently added to?
 
Top