> For the complete documentation index, see [llms.txt](https://jsf.gitbook.io/jsf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jsf.gitbook.io/jsf/form/value.md).

# Form data

### Reading & writing form data via functions

There are 4 main functions for getting and setting values:

* getValue
* getJsonValue
* setValue
* setJsonValue

All form controls have this function. Example:

```typescript
const form = await JsfBuilder.create({ /* your schema definition */ });

const allData = form.getValue();
const email = form.getProp('user.email').getValue();

form.getProp('user.email').setValue('example@example.com');
```

### Reading and writing via value proxy

Sometimes you might like to use a more natural way of reading and changing values. For that purpose `value` property exists on form instance. Under the hood we are using Proxy and calling `getValue` and `setValue` functions for every get and set, meaning that for every read you will get copy of data (references are not the same).&#x20;

Example:

```typescript
const form: JsfBuilder<MyValueInterface> = await JsfBuilder.create({ /* your schema definition */ });

form.value.user.email = 'test@example.com';
// ... is same as ...
form.getProp('user.email').setValue('test@example.com');


console.log(form.value.user.email);
// ... is same as ...
console.log(form.getProp('user.email').getValue());

// Arrays also work
form.value.cities[42].name = 'Ljubljana';
```

{% hint style="danger" %}
You can't reasign `value` proeprty itself only nested properties can be read and set.

**Wrong usage:**

```typescript
form.value = { user: { email: 'example@example.com' } }
```

{% endhint %}
