---
title: "createFromListIndex"
description: "Creates a [FillableData] instance from an [Int].

This function is used to wrap an integer value for autofill purposes, such as the selected index
in a dropdown menu or spinner."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect fun FillableData.Companion.createFromListIndex(listIndexValue: Int): FillableData?
```


Creates a `FillableData` instance from an `Int`.

This function is used to wrap an integer value for autofill purposes, such as the selected index
in a dropdown menu or spinner.

#### Parameters

| | |
| --- | --- |
| listIndexValue | The integer data to be used for autofill, representing the index of the selected item in a list. |


#### Returns

| | |
| --- | --- |
|  | A `FillableData` object containing the integer data, or `null` if the platform does not support autofill. |




<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual fun FillableData.Companion.createFromListIndex(listIndexValue: Int): FillableData?
```


Creates a `FillableData` instance from an `Int`.

This function is used to wrap an integer value for autofill purposes, such as the selected index
in a dropdown menu or spinner. On Android, it creates an `AutofillValue` that represents a list
selection.

#### Parameters

| | |
| --- | --- |
| listIndexValue | The integer data to be used for autofill, representing the index of the selected item in a list. |


#### Returns

| | |
| --- | --- |
|  | A `FillableData` object containing the integer data, or `null` if the platform version is lower than `Build.VERSION_CODES.O`. |




