Skip to main content

Switch Case

The Switch Case node evaluates a script that returns 0, 1, or 2, routing the input to the matching output port.

Example: Route by File Name

var fileName = NodeInputReader.inputAsFile().getName();

if (fileName.contains("Accounting")) {
return 0; // Accounting output
} else if (fileName.contains("Human_Resources")) {
return 1; // Human Resources output
} else {
return 2; // Development output
}
  • Port 0 — File name contains "Accounting".
  • Port 1 — File name contains "Human_Resources".
  • Port 2 — All other files (default).