我正在使用Smartsheet Python SDK并尝试更新Smartsheet中的行,其中许多要更新的单元格都有指向其他工作表的现有链接。我想用数据更新单元格值,同时保持链接完整。当我尝试用新的单元格值更新行时(但是保持原始links_out_to_cells
对象附加到原始单元格),我得到了API错误1032:"The attribute(s) cell.linksOutToCells[] are not allowed for this operation."
有人知道解决这个问题的好方法吗?你知道吗
这里是我的evaluate_row_and_build_updates
函数(传入smartsheet行和pandas df中的行——smartsheet中每一行的第一个值将在更新时保留)
def evaluate_row_and_build_updates(ss_row, df_ro):
new_row = smartsheet.models.Row()
new_row.id = ss_row.id
new_row.cells = ss_row.cells
empty_cell_lst = list(new_row.cells)[1:]
for i in range(len(empty_cell_lst)):
empty_cell_lst[i].value = df_row[1][i]
return new_row
在请求更新链接的源单元格上的单元格值时,不必包含
linksOutToCells
对象。只需更新单元格值即可。到其他工作表的链接将保持不变,并且您添加的新单元格值将链接到其他工作表。 可能是这样的:在链接断开的单元格上运行该代码将保持单元格链接。你知道吗
相关问题 更多 >
编程相关推荐