''IF'' function with 3 conditions in Dynamo?

is it possible to use the ‘‘if’’ function ( conditional statement) in dynamo with 3 conditions?

If inpunt a < 3 then function a
If input 3 < a < 4,5 then function b
If inpunt a > 4,5 then function C

1 Like

Edit: Fixed my typo in the code below

You definitely can! Using a code block, type in the following:

input <= 3 ? functionA : input >= 4.5 ? functionB : functionC

3 Likes

thanks for your answer, it didn’t work, any tips?

Change =< into <= , or remove the = alltogether

2 Likes

Ah yeah, my bad on that one. Was on my phone without Dynamo at hand :frowning: Thanks for the righting of my off-course ship @Daan!

2 Likes

Like this @zzakaryae - My apologies on the syntax typo!

functionA = "I'm a funky Function called A";
functionB = "I'm a cool Function called B";
functionC = "I'm the fall-out stuff called C";

input <= 3 ? //if less than or equal to 3, return functionA
	functionA :
	input >= 4.5 ? //if greater than or equal to 4.5, return functionB
		functionB :
			functionC;
 //otherwise return functionC;
4 Likes