Work flow based on slider value selected by user

I’m looking for a way to direct the workflow in a graph based on a slider value. The slider is set to a maximum of 5 so I have 5 possible results. If this were VB.NET I’d use Select Case. What is the equivalent dynamo way? Thanks.

Need to see more of what you are doing based on the slider. Could be as simple as List.GetItemAtIndex or an If statement.

Thanks Jacob.
If slider = 1 then 1 door, If slider = 2 then 2 doors… In the end the selection will fill in a text parameter.

So this then:
“2 Doors”:
“3 Doors”:
“How many doors do you want?”;

5 doors. Thanks

I intended that as “you can see the pattern now and continue this for how ever many doors you want”…

But looking at it now, I’d go another route:

X+" Doors";

Thanks. Does that go in a code block?

Yes. Post your graph if you’re still lost after this.

Here’s that portion of the graph. Thanks.


Place the previously provided text in a code block above and let me know what the issue is.

Thanks. The last code worked however I prefer your original version if I can make it work. I may use it for other things and they may not be sequential.

here’s the error I’m getting with the original version. Syntax error I’m guessing.


you need an else value for the last if statement. “well this is weird as the inputs should have been limited to 5” could go in before the “;” to fix that.

Hmmm. I still have something wrong…


Saw the double X at the start. Took it out but still not working, Thanks for the assistance.


You should consider reading the Dynamo Primer
It describes the use of code blocks as well.

Perfect. Thanks.