1

使用 Smartsheet Python SDK,我正在运行以下代码来访问 Smartsheet:

  1. 从“客户名称”列获取客户列表
  2. 使用从 1 获取的客户列表更新“客户名称”列的 Picklist。

import smartsheet

# Initialize Smartsheet client
smartsheet_client = smartsheet.Smartsheet(my SMARTSHEET_ACCESS_TOKEN)
sheet_Customer = 5623822008248192         
column_Customer_name = 4467860205528922      

sheet = smartsheet_client.Sheets.get_sheet(sheet_Customer) 
Customer_list = []
for row in sheet.rows:
   for cell in row.cells:
        if cell.column_id == column_Customer_name:
            Customer_list.append(cell.value)
        
Customer_list.sort()   # ABC Sort

# Specify column properties
column_spec = smartsheet.models.Column({'type': 'PICKLIST', 'options': Customer_list})

# Update customer list to "Customer name" column
response = smartsheet_client.Sheets.update_column(sheet_Customer,column_Customer_name, column_spec)  

上述编码在 Pycharm 中运行良好。现在我想在 Zapier 中运行它,但 Zapier 不支持 Python SDK 而是支持 Python 请求。您能否帮助使用 Python 请求对上述内容进行编码,以便它可以在 Zapier 中运行而无需使用 SDK?

感谢你的帮助。

4

0 回答 0