Jump to content

Drive a switch with a detail


Recommended Posts

Hello ODF,

Thanks for all the help, this is a great site for looking up things but i have to dip my toe in and ask a simple question:

I'm having trouble with an expression inside a switch node, i want to change the switch from one input to another based on detail I've created from a filename

I'm a complete novice when it comes to expressions, would someone steer me right here?

Thanks in advance!

switchnode2.thumb.jpg.656b375a6beecb37190a55f99caebbdf.jpg

Link to comment
Share on other sites

Another way you could do it which is the way I usually deal with it when I use expressions like this in a switch node is that I just use vex to make sure that the attribute I am looking up is a number and then just look up the number attribute with the switch.

So essentially just put a wrangle down where you do the whole

if(s@gender == "M")
{

          i@switch_num = 0;

}
else if(s@gender == "F")

{

          i@switch_num = 1;

}

And then in your switch just do:

detail("/path/to/node", "switch_num", 0)

 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...