Hi All! I wrote a Python script that will run an update to make changes when a form submission is added. Works great, however I have to manually run the script. I know you can use a scheduler to run, but I need the automation to trigger when form is submitted. I do not have a server and from what I have read, Flask and Ngrok has been mentioned on other chats. Is this the way to go or is there another solution any of you may know of.

Any help is appreciated!




  • Lee Joramo
    Lee Joramo ✭✭✭✭✭✭

    I would say that you have three basic choices. I use all of these in my work. From easiest to hardest

    1. Use a task scheduler set to run once a minute. I would say that the vast majority of Smartsheet automations can be run within a minute timeframe. You on Linux or macOS you use cron , and on Windows you would use Task Scheduler to automate. The API rate limit is 300 requests per minute. So in most cases you will be fine burning one requests per minute.

      The issues with this method are the added latency of up-to a minute. And if you re doing this across many sheets, you can quickly burn up your API requests.

      The benefit is that you are basically almost done with this project, and you do not need to setup any sort of server or mess with tools like Ngrok. This will be highly reliable with little extra monitoring.

      You can also use this method to rewrite you script to make multiple requests via a timed loop. So that you could make it check once a second. This will certainly burn more API requests, but is still very simple to setup and maintain.
    2. Setup an Smartsheet Workflow Automation to send a email to a mail box that your Python Script can monitor. This will require you to make you python script a long running process, that can fetch mail from every few seconds.

      The issues are that you will need access to an email box. A POP server is ideal, but IMAP will work too. And you will need to setup some monitoring for this Python script. If you have experience with Smartsheet Email Workflow notifications, you will know that emails get sent anywhere from a few seconds to a few minutes after a triggering event. So this may not always be faster that the pure scheduling method.

      This is the old school 1990's way of automating. I would go with it if the latency is acceptable AND you don't want to burn API calls AND you don't want the complexity of the next option.

      One advantage of this method, is that for some use cases, the email can contain row data from Smartsheet, and may eliminate (or reduce) the need for any API calls.
    3. Finally you could setup a server. Regardless of if this is a small service running in the background of your always on Desktop Workstation, dedicated hardware, or a cheap server hosted as a VPS in with a provider like Linode. If you run this on a Workstation or a small in-house server, Ngrok could be part of the solution

      Here we are really talking about setting up to receive WebHook calls from Smartsheet to your system. These calls typically are received within a few seconds. WebHooks are the least costly in terms of API limits and the fastest response times.

      Your investment in time to implement WebHooks could be excessive. You are setting up and securing a web application stack, and then learning and coding the WebHooks.

  • Nikki17
    Nikki17 ✭✭✭

    Thank you, Lee! I think I will go with Step 1. I don't have that many sheets so I think I should be fine with opting for #1.

    I appreciate the help!