Python API Copy Sheet - Data not copying to new sheet

Options
cabbsman
cabbsman ✭✭✭✭
edited 04/17/23 in API & Developers

I am copying a sheet (source) to a new sheet (destination) using Smartsheet's SDK API. The copy of an empty sheet is the result. I tried the include parameter but it makes no difference. Does anyone know the correct syntax to use so when I copy a sheet the data within is copied to the destination sheet as well?

Here's SMartsheet's SDK Python example:

response = smartsheet_client.Sheets.copy_sheet(
  4583173393803140,                               # sheet_id
  smartsheet.models.ContainerDestination({
    'destination_type': 'folder',               # folder, workspace, or home
    'destination_id': 9283173393803140,         # folder_id
    'new_name': 'newSheetName'
  })
)

Here's my script with the include parameter:

#!/usr/bin/python3.8

import smartsheet

smart = smartsheet.Smartsheet()

response = smart.Sheets.copy_sheet(

 7134853598236548,                # sheet_id

 smart.models.ContainerDestination({

  'destination_type': 'folder',        # folder, workspace, or home

  'destination_id': 8269922569611140,     # folder_id

  'new_name': 'newSheetName',

  'include': 'data'

 })

)


Thank you!

Best Answer

Answers