Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Creating a downloadable output via the Python tool

tristank
11 - Bolide

Hello all!

 

I am using openpyxl to generate and format an Excel file within the Python tool. I would like to be able save the Excel file within the script so that it is downloadable via a Gallery app.

 

Ignoring the openpyxl for a moment, just testing with a CSV I have:

 

1. Relative output: dataframe.to_csv(file_name)

2. Using os to pull the temp directory to make sure it is outputted there

3. Used Alteryx.getWorkflowConstant("Engine.WorkflowDirectory") to force the output to go where the workflow exists

 

No matter what I do I can't get the file to be downloadable, either locally or in gallery. The file does output to the temp location or the workflow location (depending on my options above) but that is it.

 

Thanks for any assistance <3

2 REPLIES 2
binuacs
21 - Polaris

@tristank have you checked whether the "Engine.WorkflowDirectory" giving the path whether the workflow located?

from ayx import Alteryx


# Get the directory path of the current workflow
workflow_directory = Alteryx.getWorkflowConstant("Engine.WorkflowDirectory")
print("Workflow Directory:", workflow_directory)

 

tristank
11 - Bolide

@binuacs here is a sample of my tests with the 'Engine.WorkflowDirectory'

 

When I run it locally as an app the file gets dropped in the workflow location but there are no downloadable output files :/

 

 

 

 

 

Labels