# SetText

> Types the specified text into a target UI element, recognized by Mobile Automation.

Types the specified text into a target UI element, recognized by Mobile Automation.

## Definition

**Namespace**: UiPath.MobileAutomation.API.Models

**Assembly**: UiPath.MobileAutomation.API (in UiPath.MobileAutomation.API.dll)

## Overloads

|  |  |
| --- | --- |
| `SetText(IElementDescriptor, string, MobileOptions.SetTextOptions)` | Types the specified text into a target UI element, identified as an `IElementDescriptor`. |
| `SetText(ObjectRepositoryTarget, string, MobileOptions.SetTextOptions)` | Types the specified text into a target UI element, identified as an `ObjectRepositoryTarget`. |
| `SetText(SelectorTarget, string, MobileOptions.SetTextOptions` | Types the specified text into a target UI element, identified as a `SelectorTarget`. |

## `SetText(IElementDescriptor, string, MobileOptions.SetTextOptions)`

Types the specified text into a target UI element, identified as an
`IElementDescriptor`.

```
SetText(
	    IElementDescriptor element,
	    string text,
	    MobileOptions. SetTextOptions options = null
)
```

`element`
:   A UI element from the Object Repository that you access using the
    `ObjectRepository.Descriptors` class.

    Visit [Using objects in coded automations with
    Mobile Automation](https://docs.uipath.com/studio/standalone/2024.4/user-guide/creating-an-object-repository#using-objects-in-coded-automations-with-mobile-automation) to learn how to use Object Repository elements
    with mobile automation.

`text` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)
:   The text you want to type into the specified UI element, stored in a
    string.

`options` [MobileOptions.SetTextOptions](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-mobileautomation-api-models-mobileoptions-settextoptions#mobileoptionssettextoptions-class) (Optional)
:   Specifies the `MobileOptions.SetTextOptions` for the set text
    action. Default value is null.

## `SetText(ObjectRepositoryTarget, string, MobileOptions.SetTextOptions)`

Types the specified text into a target UI element, identified as an
`ObjectRepositoryTarget`.

```
SetText(
	    ObjectRepositoryTarget objectRepositoryTarget,
	    string text,
	    MobileOptions. SetTextOptions options = null
)
```

`objectRepositoryTarget` [ObjectRepositoryTarget](https://docs.uipath.com/activities/other/latest/ui-automation/objectrepositorytarget#objectrepositorytarget)
:   An object of type `ObjectRepositoryTarget`.

`text` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)
:   The text you want to type into the specified UI element, stored in a
    string.

`options` [MobileOptions.SetTextOptions](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-mobileautomation-api-models-mobileoptions-settextoptions#mobileoptionssettextoptions-class) (Optional)
:   Specifies the `MobileOptions.SetTextOptions` for the set text
    action. Default value is null.

## `SetText(SelectorTarget, string, MobileOptions.SetTextOptions`

Types the specified text into a target UI element, identified as a
`SelectorTarget`.

```
SetText(
	    SelectorTarget targetSelector,
	    string text,
	    MobileOptions. SetTextOptions options = null
)
```

`targetSelector` [SelectorTarget](https://docs.uipath.com/activities/other/latest/ui-automation/selectortarget#selectortarget)
:   An object of `SelectorTarget` type. Can be constructed using
    `FromSelector(String)` method.

`text` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)
:   The text you want to type into the specified UI element, stored in a
    string.

`options` [MobileOptions.SetTextOptions](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-mobileautomation-api-models-mobileoptions-settextoptions#mobileoptionssettextoptions-class) (Optional)
:   Specifies the `MobileOptions.SetTextOptions` for the set text
    action. Default value is null.
