i'm creating a workflow that (1st control container) checks to see if a dir exists, if it doesn't it will create it, then (2nd control container) move .csv files from path A to this newly created/existing path. they work when run separately but don't when combined. want to see if adding a delay between the 2 containers would help.
Couple things:
This should work. But given your illustration, do you have the control containers connected so they run in sequence? Otherwise, they are going to attempt to run at the same time... See red line:
But a better option might be to create the CSV into a temp location, then simply use the Run Command to Create the directory if it doesn't exist and then move the file. You can even have the Run Command tool run multiple statements in order if needed.
Hope that helps, -Jay
i did have them connected and it still wasn't working. i disconnected them to test running them separately to ensure they ran successfully.
There is a Wait a Second macro available from the CReW macros - just do a quick google search and download/install them!
If your environment does not allow you to install third-party tools, you can use a Python tool with time.sleep() function. Below is the sample code:
import time
from ayx import Alteryx
# Wait for 5 seconds
time.sleep(5)
i have never used the python tool previously so sorry if these are simple/stupid questions. where do i put the code? do i link the control container to the python tool or the run command tool? which output number do i link to the 2nd control container.
Hi @cvinju,
I posted a reply to an idea regarding Adjustable Delay for Control Containers which is relevant to the issue you are experiencing. You can copy the code block contents I posted in that reply and save it as a YXMD file, then open it in Alteryx Designer and copy the delay part.
The only thing you will need to change to make it work correctly is the Text Input tool content, containing the URL to a local file on your computer. It can also be configured to read and download the workflow itself. If necessary, you can also configure the Throttle tool to adjust the delay. Just keep in mind that it is best to copy all the related tools to your workflow from the workflow I shared at once.
If you would like to place the tools on the canvas by yourself, place all the tools between the control containers that is going to connect them in sequence (including the Text Input tool to be connected to the Append tool) except for the Throttle tool. Only after placing all the tools should you insert into connection the Throttle tool before the Download tool. Otherwise, the Download tool will not be able to find the URL field.