> For the complete documentation index, see [llms.txt](https://luadoc.edgetx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luadoc.edgetx.org/edgetx-v2.8/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourceindex-sourcename.md).

# getSourceIndex(sourceName)

#### Parameters

* `sourceName`: string naming a value source as it is shown on radio menus where you can select it. Notice that many names have [special characters](/edgetx-v2.8/part_iii_-_opentx_lua_api_reference/constants/special-character-constants.md) in them.

Return value

* `sourceIndex`: integer. The source index, which can be used as input for `getSourceName(sourceIndex)`, `getValue(sourceIndex)`, and `getFieldInfo(sourceIndex)`.

#### Notice

The source names shown on the screen are not the same as the names used by `getFieldInfo` and `getValue`. But the indices are the same, so e.g. `getValue(index)` will work with the indices obtained here.

This function is rather time consuming, and should not be used repeatedly in a script, if it can be avoided.

#### Status

Current Introduced in 2.6


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://luadoc.edgetx.org/edgetx-v2.8/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourceindex-sourcename.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
