Retrieving Strikethrough Formatting with Python SDK

Options

Hi all,

I'm using the Smartsheet Python SDK to fetch data from my sheets. While the data retrieval works well, I'm encountering a limitation where cell formatting, specifically strikethrough, isn't captured.

Currently, the retrieved data appears without the strikethrough even though it's displayed that way in the sheet.

Is there a way to access cell formatting information like strikethrough using the SDK?

As an alternative, are there any suggested workarounds to identify rows marked for cancellation (potentially via a specific value in a designated column)?

Thanks in advance for any insights!

Best Answer

  • jmyzk_cloudsmart_jp
    jmyzk_cloudsmart_jp ✭✭✭✭✭✭
    Answer ✓
    Options

    Hi @Dev106

    You can get formatting information by specifying include when you get a sheet.

    sheet = smartsheet_client.Sheets.get_sheet(
        sheet_id,
        include = ['format']
        )
    

    Then, if you access a cell, the cell has formatting information like this;

    {"columnId": 3564341938048900, "displayValue": "Test 1", "format": ",,,,,1,,,,,,,,,,,", "value": "Test 1"}
    

    Then, referencing the format description table, you can determine which formats are applied to the cell, strikethrough, in this example.

    https://smartsheet.redoc.ly/#section/API-Basics/Formatting

Answers

  • jmyzk_cloudsmart_jp
    jmyzk_cloudsmart_jp ✭✭✭✭✭✭
    Answer ✓
    Options

    Hi @Dev106

    You can get formatting information by specifying include when you get a sheet.

    sheet = smartsheet_client.Sheets.get_sheet(
        sheet_id,
        include = ['format']
        )
    

    Then, if you access a cell, the cell has formatting information like this;

    {"columnId": 3564341938048900, "displayValue": "Test 1", "format": ",,,,,1,,,,,,,,,,,", "value": "Test 1"}
    

    Then, referencing the format description table, you can determine which formats are applied to the cell, strikethrough, in this example.

    https://smartsheet.redoc.ly/#section/API-Basics/Formatting