lmarchisio
lmarchisio

Reputation: 1

Row # in Smartsheet API with Python

I'm looking for a way to include the row number in a formula when updating multiple cells in using the Smartsheet API (Python). The goal is to create a column then put a formula that dynamically references other columns in each new cell. I have all of this worked out EXCEPT how to make the formula reference the row it is in instead of statically referencing one row. I can retrieve the rowID. But that is not useful when looping through to update cell formula.

I can do all of this manually in Smartsheet. But using the API would save me a huge amount of time.

Any suggestions on how retrieve the row#'s in a way that can be used to update cells would be appreciated.

Upvotes: 0

Views: 1104

Answers (2)

daveskull81
daveskull81

Reputation: 637

If your formula is referencing columns and cells across the row you can use the @row functionality in Smartsheet formulas to reference them without the row number. You can add this in the text for your formula you provide via the API and Smartsheet will reference the row as needed. More info on this is in the Smartsheet Help Center here: https://help.smartsheet.com/articles/2476491-create-efficient-formulas-with-at-cell

Upvotes: 0

Software2
Software2

Reputation: 2738

Row numbers are not permanent identifiers of a row. If a row is added or deleted above a row, the row number of that row will change. The rowID will always remain the same for a given row. This is why the API uses the rowID instead of row number as the key to find information about each row.

Formulas do require row numbers. This can be retrieved from the API. rowNumber is a property of each row. See the API documentation for details.

Upvotes: 1

Related Questions