Hi, I have an issue I need to solve. I have output data to an Excel file with render tool on the Alteryx server. However I would like to add password to the file. I am planning to use Python code to add password to the Excel after it is created. But the problem is the Excel generated by render tool is sitting at a temp staging folder dynamically created, which is also different from the default folder where Python runs. So I am not able to let Python know where to pickup the file. I know on desktop version we can specify a fixed location for the file so both tool can access it. Just don't know how I can achieve this on server. So the question are 1) is there a way to get a path of the temp staging folder and pass it to the Python? 2) any other way to add password to the Excel, maybe within Render tool?
Thanks,
Solved! Go to Solution.
Hi @ArtShen
1) is there a way to get a path of the temp staging folder and pass it to the Python?
Please try to use %temp% or [Engine.TempFilePath] to get the temp folder.
We can use %temp% at output folder tool and [Engine.TempFilePath] at Formula tool.
2) any other way to add password to the Excel, maybe within Render tool?
No. At Render tool, we can not set the password.
Thanks @AkimasaKajitani for your response which leads me the right direction. I found [Engine.TempFilePath] only gives the temp directory while [Engine.WorkflowDirectory] gives me the exact path of the file created. Also Alteryx have already provided a Python package that can get the path. Here is a piece of Python code :
from ayx import Alteryx
dir=Alteryx.getWorkflowConstant("Engine.WorkflowDirectory")
excel_file_path=dir+"\myexcel.xlsx"
I am able to pick up the Excel file created by the render tool and add password to it with Python.
I forgot to mention the Python tools.
You are right😀
If you have solved the problem, please mark it as a solution. This will make it easier for others to find the answer.
hi,
I have seen your solution on encrypting excel output from render. I would want to password protect my excel file coming from render tool in alteryx.
Can you tell me how to connect to python in alteryx and output the file with password?