Enum

Read with AI
All docs in one file (llms-full.txt)
Enum

Selects one of the choices written on the node and outputs its name to Name and its number to IndexOut. Where StringArray is a “number → string” converter, this one is a node that holds a selection state and is operated with the dropdown and triggers. You can give names to numbers and use it as an outlet for switching presets.

Editing the choices

  • Write them one item per line in the text field on the node. Whitespace at either end of a line is dropped, and empty lines do not become items
  • The items are listed in the dropdown above, and picking one selects that item
  • A Loop toggle (default ON) sits below
  • The choices, the current selection and Loop are saved in the project

How to select

  • Next / Prev — moves the current position by ±1
  • Reset — goes back to number 0
  • Index — specifies the number directly. Only one connection is allowed. While it is connected, the value coming from outside takes priority, and operating the dropdown and Next / Prev / Reset are ignored (the dropdown goes back to the current selection)
  • Numbers out of range behave differently depending on the state of Loop. With it ON they wrap by the modulo of the element count (negative values wrap around to the end); with it OFF they are clamped to 0 - (element count - 1). Next / Prev follow the same rule, so with Loop OFF they stop at the ends

Outputs

  • Name — the string of the selected item
  • IndexOut — the number of the selection (0-based)
  • Count — the number of items
  • Changed — a trigger that fires only at the moment the selection actually changes. It does not fire when you rewrite the choices text or load a project, and it does not fire when you re-select the same number

Name / IndexOut / Count are only sent when the value changes.

When the choices are empty

With no items at all, neither the dropdown nor Index nor Next / Prev / Reset does anything. Name is an empty string, IndexOut is 0, and Count is 0.

Input ports

Port IDType
Indexint
Nexttrigger
Prevtrigger
Resettrigger

Output ports

Port IDType
Namestring
IndexOutint
Countint
Changedtrigger

Scriptable members

PathType
indexInputint
entriesTextstring
currentLoopbool

Synapse Apps (scripting)

await synapse.modules.create({ type: "Enum" })

Pages linking here

Also referenced from