Skip to main content
Question

Perform Math Operation on an Array of Numbers

  • November 21, 2024
  • 3 replies
  • 32 views

I am updating many spreadsheet rows in a google sheet.  I need the data to start on row # 2.  In the screenshot, you can see the data is starting on row # 21.  Is there a math operation I can setup for the array value to start at row # 2?

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

3 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • November 21, 2024

Hi ​@Kyle M 

The attachment did not upload.

You may have to use a Code step to do the math operation: https://zapier.com/apps/code/help

Try using the AI in the Code step to generate the custom code for you: https://help.zapier.com/hc/en-us/articles/15666688064013-Generate-a-Code-step-using-AI-Beta


Badger
Forum|alt.badge.img+5
  • New
  • November 22, 2024

In your screenshot it looks like you’re sending the row numbers to update starting at row 21 from step 12. Formatted Rows Row.

You’ll need to edit the output here either as Troy suggests by code or through a formatter into step 12. To ensure that the row number starts with row 2. 

In Python it would be a simple case of creating and returning a list of the row numbers. 
 

last_row_number = 10 #  this can be replaced by input from another step


# Generate the list of numbers starting from 2 to last row

number_list = list(range(2, last_row_number + 1))


# Return the result

output = {"number_list": number_list}

 


 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • November 27, 2024

Hello ​@Kyle M! 👋

Did the Code step Troy and Badger suggested do the trick? Keen to hear if it worked for you! Let us know if you’re stuck—happy to assist further. 🙂