How do I indent rows in Smartsheet using the python API?

98 Views Asked by At

I need to setup an auto indent for a client. He's importing data using data shuttle but the csv file tracks levels in a column called Level. I need to read the value in level and indent the row accordingly. So for example it it's 0 then it stays a parent row. If it's 1 then it's a child row (and it's parent will be the row immediately above it) and so on.

is there a way to do this programmatically using the API since i can't find a way to do this using Data Shuttle

I looked at the Api docs and it doesn't provide example code for this

1

There are 1 best solutions below

1
Aravind Pai On
for row in rows:
if row.id in Project_row:
    for cell in row.cells:
        if cell.column_id == thisColumn and cell.value == 0:
            row_1 = smart.models.Row({
                'cells': [newCell_1],
                "parentId": row.id, 
                "toBottom": True
                })

Try this code