Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Python triggered from Microsoft Flow

Would anyone know what is the approach to call Python application/script (which relies on imported libraries like pandas) from Microsoft Flow?

The complete problem is like this. Client uploads something to Dropbox (it is how his ERP works). This action is linked to our Microsoft Flow so whenever he uploads it, Microsoft Flow registers it (now it just redirects it to us). What I need to do after is run the Python application/script on that file in Dropbox after he uploads it. I can put my Python directly into that Dropbox. What I do not know is how to trigger it and ensure it runs (is interpreted).

Thank you for any suggestions.

like image 207
eXPRESS Avatar asked Jun 25 '18 09:06

eXPRESS


People also ask

Can you run Python script in Microsoft Flow?

You can bind the python script inside azure function and you can use flow to pass input to the azure function. The flow will call the azure function API and processing will be performed and the result will be returned back to flow.

Can I run Python script in Power Automate?

These actions enable users to run blocks of code and implement custom behavior in Power Automate. All scripting actions follow the basic structure of the respective programming or scripting language: PowerShell, Python, VBScript, and JavaScript.

Can we run Python script in Sharepoint?

A Python script to automate uploading to Sharepoint Python scripting is a great way to automate many processes that you use daily such as updating an excel spreadsheet with data from an API, sending out daily PDF reports, or uploading files to a google cloud.


1 Answers

To execute any code locally from MS flow, install and configure On premises gateway as per the instructions in the below link

https://docs.microsoft.com/en-us/flow/gateway-reference

Create a flow to copy the new file from dropbox to the local filesystem

Create a watcher to the local directory for any new file creation and execute the python code for the new file.

Refer the below link for the powershell script execution. Similar process can be designed for python

https://flow.microsoft.com/en-us/blog/flow-of-the-week-local-code-execution/

like image 150
Dinesh Avatar answered Oct 13 '22 21:10

Dinesh