Best answer

How to update python code?

  • 30 July 2020
  • 4 replies
  • 181 views

Userlevel 1

Hi there!

I’m trying to work out how I could solution the following challenge. 

 

  • A user will use a Smartsheet form to request a backup.
  • I have some python code sitting on a local server, which i have been updating manually with the details from the submitted form. eg. Folder ID
  • The code is then executed as part of a scheduled cron job

 

What i’m looking to do is to take the request details from Smartsheet and parse them into the python file so i don’t need to manually edit files. Are there any ideas as to how i could  achieve this?

 

Note: I’m not looking to execute the python script on Zapier, just, update the code within the python file.

 

Thanks for any help,

 

Sean

icon

Best answer by Sean Williams 2 August 2020, 10:21

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 4
Badge +5

Hey Sean! This sounds like a really useful workflow. I don’t think we have a way to upload a file to a server, but you could you use something like Dropbox? Our Dropbox integration can add text to and create text files, and I could imagine that working, even if you have to set up a cron task to sync from Dropbox over to your file after. 

I’d offer more advice but this realllllly seems like it might be over my head—I think pythons are snakes. But I hope the suggestion is helpful. 

Userlevel 1

I totally agree! Pythons are snakes :)

I was taking a look and found OneDrive - create a file from template will be really useful for this, depending on how easy/hard it will be to retrieve the file in OneDrive, otherwise, Dropbox will work too. 

 

Thanks for your response.

Userlevel 7
Badge +7

Great idea @jpot . If that doesn’t work, maybe you can have your python code expose a webhook and let Zapier call this webhook. You can then send some JSON data with all the stuff you need towards the script, which would automatically take actions from there.

Let us know how it goes! :D

~Bjorn

Userlevel 1

All done!

I went the low tech route - with something that looks like this: 

Trigger: When a row is updated in Smartsheet

Do this:

  Only continue if Backup script created is not true

  Format the filename to replace [space] with _

  Create new text file in OneDrive (based on a template)

  New row update in Smartsheet (update the Backup script created checkbox)

 

All that will remain to be done is to update the file extension from .txt to .py

 

Thanks for your ideas. 

 

Sean