# getSwitchIndex(positionName)

@status current Introduced in 2.6

## Parameters

* `positionName`: string naming a switch position as it is shown on radio menus where you can select a switch. Notice that many names have special characters in them like arrow up/down etc. (see [Special Character Constants](https://luadoc.edgetx.org/edgetx-v2.8/part_iii_-_opentx_lua_api_reference/constants/special-character-constants)).

## Return value

* value: integer. The switchIndex, which can be used as input for \`getSwitchName(switchIndex)\` and \`getSwitchValue(switchIndex)\`. Also corresponds to the fields in the table returned by \`model.getLogicalSwitch(switch)\` identifying switches.
