https://flyte.org logo
#ask-the-community
Title
# ask-the-community
a

Andrew

01/09/2024, 10:20 PM
Quick
conditional
question. Is there a way to resolve a result from a conditional, but only if its true? Something like this:
Copy code
result = ""
result = conditional("cond").if_(<conditional statement>).then(run_task()).else_().then(result)
Obviously this is a bit contrived, but is there a way to use a conditional like a single if, rather than having to run a different task if its not true? If that makes sense
s

Samhita Alla

01/10/2024, 6:49 AM
is this what you're referring to? https://github.com/flyteorg/flyte/issues/3533
a

Andrew

01/10/2024, 3:21 PM
Yes, it looks like it. But I would also love to be able to assign the result of the conditional to a variable, so that when the
else_
runs, it can assign the variable a default value, if that makes sense. So a task would only run if the condition is true, and if the task doesn’t run, the output of the conditional could be a default value
4 Views