This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delete_rows_in_batches(sheet_id, batch_size=300): | |
row_ids = [row.id for row in smartsheet_client.Sheets.get_sheet(sheet_id).rows] | |
num_rows = len(row_ids) | |
num_batches = (num_rows // batch_size) + 1 | |
for i in range(num_batches): | |
start_index = i * batch_size | |
end_index = min(start_index + batch_size, num_rows) | |
batch_row_ids = row_ids[start_index:end_index] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import smartsheet | |
import csv | |
# Uncomment and set your Smartsheet API access token | |
# access_token = 'YOUR_ACCESS_TOKEN' | |
# Initialize the Smartsheet client | |
client = smartsheet.Smartsheet(access_token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smartsheet | |
def remove_start_date(sheet_id, row_number): | |
access_token = "" # your access token | |
smartsheet_client = smartsheet.Smartsheet(access_token) | |
sheet = smartsheet_client.Sheets.get_sheet(sheet_id) | |
# Create Column Map | |
column_map = {} | |
for column in sheet.columns: |