我目前正在尝试将 Excel 工作表导入 Smartsheet,然后获取导入工作表的行,并将它们移动到现有工作表的底部。为此,我使用 Sheets.move_row 函数。下面是该代码的片段。
response = smart.Sheets.move_rows(
result.data.id,smart.models.CopyOrMoveRowDirective({
'row_ids': [**Help**],
'to': smart.models.CopyOrMoveRowDestination({'sheet_id': 1174866712913796})}))
要获取有关导入工作表的信息,我使用 get_sheet 命令。我的计划是然后遍历 sheet.row 属性并找到列出“id”的位置,然后将 id 旁边的数字拉到逗号分隔的列表中。
下面是我尝试遍历行属性的片段,但我不确定如何提取行 ID,然后将它们放入逗号分隔的列表中。
sheet_info = smart.Sheets.get_sheet(result.data.id,_dir)
print(sheet_info)
for id in sheet_info.rows:
x = id
print (x) #this just prints the cells category
任何帮助将不胜感激,谢谢。如需进一步说明我想要做什么,请参考我之前发布的问题。