Switch it up

In this video, you will learn:

  • What switch functions and modules are and how they differ
  • When to use a switch function vs a switch module
Transcript
When the output from a module in your scenario is not what you can use or needs to be changed into some sort of other value, you can look to using the Switch function or the module. The Switch function is generally used for more simple value changes. As you can see at the right, an expression or some sort of input is going to be evaluated against different values. If it matches one of those values it’s going to produce a different result or output. At the end, if it doesn’t match any of those values, there is an else output, which will be the final result if no value is matched. For more complex changes in values you might look to use the Switch module. The Switch module behaves essentially in the same way except for with the help of the mapping panel, you can really broaden how you evaluate an input against different values in what you deliver as an output. As you can see at the right, the input can be a single item or value from a previous module, or you could create some sort of expression. Whatever you put into that input will be evaluated against different cases that you establish. If it matches one of those cases, then it will produce an output, and again, you can use the mapping panel to create something simple or more elaborate. There’s also an else statement below, which we can’t see in the image, but if it does not match any of the cases, then it will result in that else statement. -
recommendation-more-help
c9fbcf61-6d19-481e-a9ab-f54a0ae0ee8a