Alteryx Designer Desktop Discussions

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

Is my python tool being executed even though its not connected to any other tools?

wonka1234
10 - Fireball

Hi,

 

I have a python before my workflow. This python is to move a file to my network drive. Which I cannot do in my later python for reasons out of my control.

 

My first python moves a local file to a network drive. My workflow reads that file in the file input tool and then does some more python ontop of that.

 

How can I rework this? I dont think my first python tool is doing anything as it is not connected. But I must move my python to network file and THEN read it in.

 

Any advice would be appreciated.

 

wonka1234_0-1668363320016.png

 

9 REPLIES 9
apathetichell
18 - Pollux

I'm 95% sure that your python tool will run even if it is not connected.... If you need to trigger execution (ie python tool and then input data tool) add your input data part to a macro and trigger it with dummy data passed after your python tool. If you want input data tool and then unconnected python tool - do the opposite (python in macro). Basically - macros and dummy data/append fields/block until done are your friends here.

Felipe_Ribeir0
16 - Nebula

Hi @wonka1234 

 

One way to do this:

 

1)You can add this piece of code at the end of the first python tool. This will basically write a column AllowContinue with the value 1 after the file is moved

 

data = [{'AllowContinue': 1}]
df = pd.DataFrame(data)
Alteryx.write(df,1)

 

2)then you can use the append tool to allow the rest of the workflow to run after 1 is executed. Use the dynamic tool to read the file

Felipe_Ribeir0_0-1668364617870.png

 

A similar idea was used here if you want to check out: Create directory if not exists and save the ouput - Alteryx Community

wonka1234
10 - Fireball

im confused on how this works. 

 

do you have a workflow? 

 

What is in the append tool? 

 

How do I read in my network file?

why text input?

Felipe_Ribeir0
16 - Nebula

Hi @wonka1234 

 

can you share your workflow?

 

What is in the append tool? Nothing, just allow more than 16 records on it.

 

How do I read in my network file? With the dynamic input tool

 

why text input? To put the filepath of your input on it, it will be used on the dynamic input tool

Felipe_Ribeir0
16 - Nebula

@wonka1234 

 

Check the attached example. It is FIRST executing the python code and AFTER THAT reading the file

 

Felipe_Ribeir0_0-1668367516701.png

 

wonka1234
10 - Fireball

@Felipe_Ribeir0 

 

Cant open your workflow :( 

 

whats in the dynamic tool?

Felipe_Ribeir0
16 - Nebula

@wonka1234 

 

You can search the tools on the upper right search box of your alteryx and see examples of how to use them

 

Felipe_Ribeir0_0-1668371959782.png

 

wonka1234
10 - Fireball

@Felipe_Ribeir0 

 

Im trying to use it. It cannot find my path.

What settings did you use in the dynamic path

Felipe_Ribeir0
16 - Nebula

@wonka1234 

 

On the edit, put the path of your file

 

On the field, put the column that is passing the filepath

 

On the Action, put change entire filepath

 

Felipe_Ribeir0_0-1668372607896.png

 

Labels