[Python] Smartsheets API get_cell_history value only returned for first instance

Discussão em 'Python' iniciado por Stack, Abril 19, 2025.

  1. Stack

    Stack Membro Participativo

    I am finding that when using smartsheet_client.Cells.get_cell_history() I am only getting the first instance of 'value' but the other varaibles are fine e.g. 'modifiedAt'.

    import smartsheet as ss
    smartsheet_client = ss.Smartsheet(SMARTSHEET_ACCESS_TOKEN)
    SMARTSHEET_ACCESS_TOKEN = 'add yours here'
    sheet = smartsheet_client.Sheets.get_sheet(sheet_id=paperbased)
    for row in sheet.rows:
    cell_history = smartsheet_client.Cells.get_cell_history(paperbased, row_id=row.id, column_id=current_task_col, include_all=True).to_dict()
    for cell in cell_history['data']:
    print(f"row_id: {row.id}, modified at: {cell['modifiedAt']}, value: {cell['displayValue']}")


    output

    row_id: 4735458228627332, modified at: 2021-01-25T10:36:28+00:00Z, value: 11k Production process complete
    row_id: 4735458228627332, modified at: 2021-01-25T10:35:32+00:00Z, value: 0
    row_id: 4735458228627332, modified at: 2021-01-25T10:31:24+00:00Z, value: 0
    row_id: 4735458228627332, modified at: 2020-12-02T10:44:46+00:00Z, value: 0
    row_id: 4735458228627332, modified at: 2020-12-02T10:37:56+00:00Z, value: 0
    row_id: 4735458228627332, modified at: 2020-12-02T09:57:02+00:00Z, value: 0
    row_id: 4735458228627332, modified at: 2020-12-02T09:56:34+00:00Z, value: 0
    row_id: 4735458228627332, modified at: 2020-11-01T13:20:30+00:00Z, value: 0
    row_id: 4735458228627332, modified at: 2020-08-05T15:01:10+00:00Z, value: 0


    You can see from below there is text in the 'value' field for each row. What am I doing wrong here?

    [​IMG]

    Continue reading...

Compartilhe esta Página