How to code Python in Zapier without using Smartsheet python SDK

Using Smartsheet Python SDK, I'm running the following code to access Smartsheet to:

  1. Get customer list from "Customer name" column of a Customer sheet
  2. Update Picklist of "Customer name" column with the customer list get from 1.
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)  

The above coding run fine in Pycharm. Now I want to run it in Zapier, but Zapier does not support Python SDK but Python request. Can you help to code the above with Python request so that it can run in Zapier without using SDK?

Appreciate your help.

Best Answers

  • coby
    coby ✭✭✭✭
    edited 08/21/21 Answer ✓

    I don’t know how Zappier’s coding features work but if they won’t allow specific dependencies then you could just place the imported code directly in script. You can find the dependency code wherever you pip installed the module/package.

    Also , you can access the api without the sdk just using the request library. That’s how the wrapper works anyways.

  • Simon Google
    Answer ✓

    Dear Coby,

    Thanks for your suggestion. So far, I have coded successfully Python without importing Smartsheet sdk in the script. It has already run.

Answers

  • coby
    coby ✭✭✭✭
    edited 08/21/21 Answer ✓

    I don’t know how Zappier’s coding features work but if they won’t allow specific dependencies then you could just place the imported code directly in script. You can find the dependency code wherever you pip installed the module/package.

    Also , you can access the api without the sdk just using the request library. That’s how the wrapper works anyways.

  • Simon Google
    Answer ✓

    Dear Coby,

    Thanks for your suggestion. So far, I have coded successfully Python without importing Smartsheet sdk in the script. It has already run.