Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.

Enabling Disabling Containers based on a Condition

KirillZ
5 - Atom
Hi all,
 
I have a question regarding enable/disable container tool. I want to run a branch with Python code only on Mondays. So i've decided to put it all in a container and add a condition to enable it, but it doesn't seem to work. Maybe I missed something or there are other solutions?
 
Thanks in advance.
3 REPLIES 3
TheOC
15 - Aurora
15 - Aurora

hey @KirillZ 

Are you able to attach that part of your workflow to this thread please?

I'll have a look at your configuration.

Cheers,
TheOC


Bulien
BobR
8 - Asteroid

I don't think the condition tool works like you are trying to use it. Its meant t be used with interactive input. So if you put this tool in and run the workflow as a workflow I don't think its executing and therefore your container will always be in its default state.

What I've done in this situation is 1 of three things.

 

  1. Put code in a macro that is called from another workflow. This way the interface tools can be used and can effect change
  2. Just put a simple filter before the Monday code. If Monday I return true, otherwise return false. That way zero records are flowing into that code block effectively preventing execution.
  3. Since you are already using python you can put a check at the top of the python script to check for the day of the week.

Hope this helps. otherwise as @KirillZ said if you can provide a snippet that at least demonstrates your logic that isn't working we can give more feedback.

nduan
Alteryx
Alteryx

Hi @KirillZ 

 

I would recommend checking out this solution: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Run-Container-workflow-by-condition/td...

This would be using #1 of @BobR 's solutions above.