> For the complete documentation index, see [llms.txt](https://docs.visualyze.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.visualyze.ai/rpa-studio/file/xml/set-element-value.md).

# Set Element Value

Sets a value to a given element.

This activity sets a given value to a user-specified element in the given XML input. **XPath** is used to obtain the target element.

### Input

* **Input:** [`String Argument`](/getting-started/rpa-studio/arguments.md#string) <mark style="color:red;">`Required`</mark>\
  Set XML as input .
* **Target Element:** [`String Argument`](/getting-started/rpa-studio/arguments.md#string) <mark style="color:red;">`Required`</mark>\
  Input the XPath for obtaining the target element.
* **Element Value:** [`String Argument`](/getting-started/rpa-studio/arguments.md#string) <mark style="color:red;">`Required`</mark>\
  Input the value for the specified element.
* **Index:** [`Integer Argument`](/getting-started/rpa-studio/arguments.md#string)\
  Specifies the index at which the element is to be set. Used with Mode **`AtIndex`**.
* **Mode:**\
  Select the method where the element to be inserted. These are the available options.
  * `First(default)` - The element value is set in the first occurrence of the element specified in the XPath
  * `AtIndex` - The element value is set at a specified index.
  * `All` - The value is set at all the occurrences of the specified element.

### Output

* **Result:** [`String Variable`](/getting-started/rpa-studio/variables.md#string)\
  Stores the XML code after setting the element value in the specified [String ](/getting-started/rpa-studio/variables.md#string)variable
