Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, please Visit the Current Forums.

API write over a sheet

Gareth Mensah
edited 12/09/19 in Archived 2016 Posts

Hey, I want to feed my sight/report with a sheet refreshed once a day, however I'm not able to find a way to write over a sheet so that the sheetId remains the same. There are too many possible changes to use updateRows, as some of the rows could be removed and/or added as well as updated. Is there a way to write over sheets? 

Comments

  • Never mind, I found a way, by deleting all the existing rows and then adding all the new rows. It's not pretty but it works like a charm!

  • dAVE Inden
    dAVE Inden Employee
    edited 07/11/16

    Hey Gareth,

     

    Glad to hear you got that working. That is the process I would suggest if you are looking to have the sheetId stay the same and write over all of the existing data. Don't forget that the Delete Rows endpoint supports bulk operations, so you can send multiple rowIds at once to delete them in bulk.

     

    You could consider creating the new rows indented one level under a parent that you craete at the top of the sheet each time. Then when you are done you can delete that row and all of the child rows will go with it.

This discussion has been closed.