We are in the final days to enter our Data and Analytics - "What's your why?" raffle with SparkED!

Reply with your "why" in text/video format to our forum post by January 28 to be entered! 

Dev Space

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

Issue with a conditional statement inPython with value taken from a check box

nshapir2
7 - Meteor

I have a flow where we have a checkbox and it become either True or False depending on when its checked. That value is fed to a variable in python called

 

toggle

 

I have a script that says 

 

if toggle == True:

else:

 

sometimes when Toggle is True it read as toggle being False. I find that switching to:

if toggle: 

else:

 

 

fixes it temporarily but then after a few runs that breaks and I have to revert back. What am I doing wrong here? 

I have a little output file that outputs the value of the toggle variable in excel it comes up as True when I have it checked and False when its not checked.

 

How can I fix this?

2 REPLIES 2
TheOC
13 - Pulsar

hi @nshapir2 

Can you please attach your workflow / a scaled down version of your workflow identifying the issue?

Cheers,
TheOC

nshapir2
7 - Meteor

Sure. @TheOC  See attached.

Thank you