Skip to content

The update_rows method in smartsheet.sheets.Sheets cannot update Cells with CellLinks #53

@iemre

Description

@iemre

Describe the bug

In the following code:

smart = smartsheet.Smartsheet()

sheets = Sheets(smart)

sheet_id = "redacted"
source_row_id = "redacted"
source_column_id = "redacted"
source_sheet_id = int("redacted")

response = sheets.update_rows(sheet_id, [Row({ "id": row_id, "cells": [ 
Cell({"value": None, "column_id": display_column_id, "link_in_from_cell": CellLink({"column_id": source_column_id, "sheet_id": source_sheet_id, "row_id": source_row_id })  })
]})])

Note the "value": None bit in the Cell object.

Above code gets an error from the API:

"Required object attribute(s) are missing from your request: cell.value."

However if you pass "value": "some value to make it work" you get the API error:

cell.value must be null if cell.linkInFromCell is non-null.

So there is no way to use update_rows method for creating CellLinks.

To Reproduce

Covered by the problem description.

Expected behavior

When Cell({ "value": None }) is passed in update_rows, the SDK relays it to the HTTP API as value: null in the JSON payload.

Environment (please complete the following information):

  • OS: OSX 14.6.1
  • Smartsheet Python SDK Version: 3.0.4
  • Python Version: 3.9.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions