---
title: "onAutofillText"
description: "Action to autofill a TextField.

Expected to be used in conjunction with [contentType] and [contentDataType] properties."
type: "function"
---

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


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


> **Deprecated** Use onFillData instead

```kotlin
fun SemanticsPropertyReceiver.onAutofillText(
    label: String? = null,
    action: ((AnnotatedString) -> Boolean)?,
)
```


Action to autofill a TextField.

Expected to be used in conjunction with `contentType` and `contentDataType` properties.

#### Parameters

| | |
| --- | --- |
| label | Optional label for this action. |
| action | Action to be performed when the `SemanticsActions.OnAutofillText` is called. |




