Problems using Python API and Cell History - note returning all user input.

I have been using the cell history to try and grab user input. The Input comes from users typing or selecting from a drop down. The data shows fine in Smartsheets. Dates are auto added but text e.g. "11k Production process complete" is user input when using the report/sheet in Smartsheets.
But then when I use this code to pull the cell history for one column.
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']}")
I get this output which only gives me the value (user input) for the first row. But note it is giving the correct modified dates (compare with image above from Smartsheets above.)
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
Note both 'displayValue' and 'value' are blank. I have tried this on a few different fields and sheets using this code.
I have also tried stripping the code back to a minimal example below. But the same problem.
response = (ss_client.Cells.get_cell_history(sheet_id=paperbased, row_id=4735458228627332, column_id=2389945628288900, include_all=True))
for hist in response.data:
print(hist)
Here is the output and again it is only showing the value for the first row.
If I dig into what is returned by get_cell_history. you get ['data'] and ['result'] which seem quite repetitive. Anyway you can see that modifiedAt is working so is modifiedBy. But 'displayValue' and 'Value' are only working the first time.
Does this functionality work for others? What am I doing wrong?
Answers
-
@CamG just tried this on mine and no issues using, I can see every update value and every timeframe.
https://api.smartsheet.com/2.0/sheets/{{sheet}}/rows/{{row}}/columns/{{column}}/history?include=columnTypePrincipal Consultant | System Integrations
Prime Consulting Group
Email: info@primeconsulting.com
Follow us on LinkedIn! -
Thanks @prime_nathaniel that is helpful. Do I take it you are using the Python API? and that you have tried using that same code as me?
Do you know if access level might effect this, as I am not Admin.
-
@CamG I just did a curl for this example, so I am confirming the API is implemented correctly on SMAR side. If there is a discrepancy it could be in the python SDK specifically. You should try it with a raw custom API call to confirm this.
Principal Consultant | System Integrations
Prime Consulting Group
Email: info@primeconsulting.com
Follow us on LinkedIn!