0

I am trying to retrieve all rows in a smartsheet via the python sdk using this function:

for row in range(1,sheet.totalRowCount+1):
print sheet[row][0]

This works well in a test sheet with sample data. However, when I run the same exact lines of code on the target sheet with "live" data, I receive the error below:

C:\Desktop\Python\smartsheetclient\client_1_1.pyc in newFromAPI(cls, fields, row) 1329 column = row.sheet.getColumnById(fields['columnId']) 1330
row.logger.info("newFromAPI: column: %r", column) -> 1331 cell = Cell(row, column, fields['value'], type=fields['type'], 1332
displayValue=fields.get('displayValue', None), 1333
hyperlink=fields.get('hyperlink', None),

KeyError: 'value'

What causes this error and how can I remedy it?

Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
AME
  • 5,234
  • 23
  • 71
  • 81

2 Answers2

0

Are you using the latest version of the SDK?

On Feb 24, I made a change to the newFromAPI() classmethod of the Cell class to not blindly assume that the 'value' attribute would be present.

Based on the stack trace you published, I think that will resolve this issue for you.

If it doesn't, please let me know.

Scott Wimer
  • 91
  • 1
  • 3
0

PlansSheet = m_smartsheet.Sheets.get_sheet(sheet_id)

for row in PlansSheet.rows:

       firstRows.append(row.__getattr__('id'))