Automation
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!
Nicole
Answers
-
I would say that you have three basic choices. I use all of these in my work. From easiest to hardest
- 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 useTask 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. - 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. - 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.
- 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
-
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!
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives