我一直尝试将一行从一张工作表复制到另一张带有行附件的工作表中。在图纸之间移动行时,附件会自动复制,但在复制时不会自动复制。API文档指出,有一个"include“参数可以设置为"all",这也会导致附件被复制。有没有人愿意提供这个参数的示例,以及如何将其写入下面的内容?
如果这是基本的python,很抱歉。我对这门语言是个新手,对api也很陌生。
response = smart.Sheets.copy_rows(
18382041966468,
smart.models.CopyOrMoveRowDirective({
'row_ids': [7372751113086852],
'to': smart.models.CopyOrMoveRowDestination({
'sheet_id': 4433677678602116
})
})
)
发布于 2019-04-17 01:34:03
include
属性是在设置row_ids
和目标工作表的CopyOrMoveRowDirective
之后提供给copy_rows
方法的第三个参数。除了单元格数据外,它还需要复制以逗号分隔的行元素列表。我通过查看SDK here中的copy_rows
方法发现了这一点。
您也可以只设置单个字符串。您的include='all'
代码将如下所示:
response = smart.Sheets.copy_rows(
18382041966468,
smart.models.CopyOrMoveRowDirective({
'row_ids': [7372751113086852],
'to': smart.models.CopyOrMoveRowDestination({
'sheet_id': 4433677678602116
})
}),
include='all'
)
要使用include列表执行此操作,您可以将其设置为:
response = smar_client.Sheets.copy_rows(
4453526869960580, # sheet_id of rows to be copied
smar_client.models.CopyOrMoveRowDirective({
'row_ids': [1874694623782788],
'to': smar_client.models.CopyOrMoveRowDestination({
'sheet_id': 1955951847729028
})
}),
include=['attachments','discussions']
)
https://stackoverflow.com/questions/55698834
复制相似问题