Hi, I just want to know how we can execute a python script in alteryx?
My python script is in my local machine as you can see in the attached screenshot. The script which I want to execute/run is "front-app-download.py".
Can anyone please guide me how to do this. Thanks
Hi @AKPWZ,
I was learning python in the past but I never had a chance to use python in Alteryx myself. If my answer will be incorrect don't blame me 😛
I found this post I am assuming it should work for you:
The Python tool is another option, if you want to have the script run as part of your workflow and use the resulting data. See here for the Tool Mastery:
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Python/ta-p/197860
You can also import your existing script by going to Alteryx > Menu > Import Script.
Thank you for your response. I tried to import my python script into the python tool as you mentioned but I'm getting this error - attached the screenshot.
How can I solve this error and can run my script to see the output.
Basically my script is using some API to fetch some data as per the requirement. Thank you
Hi @AKPWZ
Can you show us the error in the python tool? It would show up like normally under the container/block with the python code. This way we can have a better understanding.
Some considerations without knowing the error:
Make sure to import all the necessary packages and libraries for Alteryx/Python.
If you are trying to pull a data input as a variable, Alteryx lists above the correct way to pull it as a variable.
To write a variable as the output to come out in one of the anchors, you need to convert it to a pandas dataframe, so make sure to call it as well.
Let me know the error and we can pinpoint what is not properly configurated.