# Append values to a field

This feature allows the user to append a non array field's value to an array type of field. The user keeps on editing the non array field and with every new entry a new row is created in the array field.

Confused? Let's dig a bit..

### What is the difference between [<mark style="color:purple;">Copy field values</mark>](https://docs.senpiper.com/form-builder/creating-forms/additional-form-settings/conditions/copy-field-values) and Append values?

| Copy field values                                                                                                                       | Append field values                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| <p>This is used to copy a non-array field to a non-array field <br>or<br>copy from an array type of field to an array type of field</p> | <p>This is used to append non-array field values to an array type of field.<br></p> |

### Need more explanation?

Let's understand with an example of two fields, **Field A** and **Field B.**

User objective: To copy field values from Field A to Field B.

For understanding purpose lets assume that Field A is non array and Field B is an array type field in both the cases.

**Case 1:** We use [<mark style="color:purple;">Copy field values</mark>](https://docs.senpiper.com/form-builder/creating-forms/additional-form-settings/conditions/copy-field-values) condition on Field B. This means, the value entered in Field A is copied to Field B.

Now what happens?

1. The user enters a value **India** in Field A and Field B automatically shows its value as **India.**

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FgubsQPXBVlnBlgABuCtu%2Fimage.png?alt=media&#x26;token=6368d797-d836-4738-8f75-926ba8423760" alt=""><figcaption></figcaption></figure>

2\. The user enters a value **USA** in Field A and Field B automatically shows its value as USA. The moment user changes the value **India** to **USA** without creating a successful submission, the value **India** is lost and the new value **USA** is the only visible value.

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FPaqT19XwBWcz7cQ8zInG%2Fimage.png?alt=media&#x26;token=49819826-39db-4fde-b31b-e14261a9ed97" alt=""><figcaption></figcaption></figure>

What if I need to retain India/USA and all other values entered in real time before creating a successful submission.

There comes the **Append values** condition. Let's see Case 2.

**Case 2**: We use **Append field values** condition on Field B. This means, the value entered in Field A gets appended to Field B.

Now what happens?

1. The user enters a value **India** in Field A and Field B automatically shows its value as **India.**

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FU7OOWVwEl0z3Hanyrgej%2Fimage.png?alt=media&#x26;token=f36e69b7-f102-4e01-88c3-ea7afe727f74" alt=""><figcaption></figcaption></figure>

2\. The user enters a value **USA** in Field A and Field B automatically shows its value as USA. The moment user changes the value **India** to **USA** without creating a successful submissio&#x6E;**,** the previous value **India** makes the 1st row and the new value **USA** makes the 2nd row of **Field B.**

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FDahIzHg9DpPQoQQlR2kY%2Fimage.png?alt=media&#x26;token=c0f87ae5-464d-4f0c-9073-00d8d030f25a" alt=""><figcaption></figcaption></figure>

So, the user can keep on giving new values to **Field A** and these values will be appended to **Field B** in the same order the user entered values in **Field A.** Once the intended list is created, the user can create a submission via clicking on **Submit** button.

### What is the use case?

Let's suppose we need to create a list of names of all the students in the class. So, we create a form with a non array textfield titled **Name** to record Name of the students and an array type of textfield titled **List** with **Append values** condition set on it.&#x20;

While creating submission, we enter 1st student name N**aveen** in the field **Name** and this value **Naveen** automatically populates in 1st row of the field **List.** We delete **Naveen** from the field **Name** and enter 2nd name **Shradha** in the same submission and this value **Shradha** populates automatically in the 2nd row of the field **List**. We erase off **Shradha** and enter the third value for the field **Name** as **Deepak** and the value **Deepak** automatically populates the 3rd row of the field **List** and so o&#x6E;**.**

Hence, we managed to create a list of all students in a single submission.

### Is there any restriction?

Yes. There are two restrictions as of now.

1. The user can append only textfield/select/multiselect/radio/email/phone fields. So, going by our [<mark style="color:purple;">**Field A/Field B**</mark>](#need-more-explanation) example. **Field A** can be any of the fields mentioned in this point.
2. The can append to only textfield type of field. So, in our example, **Field B** can be only textfield type.

The two possible scenarios for creating Append condition on a field ([<mark style="color:purple;">Field B</mark> ](#need-more-explanation)in address) can be:

1. Create an array type textfield and apply Append condition on it.&#x20;

Field A: can be any one of these - textfield/select/multiselect/radio/email/phone

Field B: textfield array type field.

2\. Create a section array with multiple textfields as its columns.

Field B: section array with textfield type columns. Let's assume we created 4 columns.

Field A: there is no one field here now. We create 4 different fields which can be any of the types mentioned (textfield/select/multiselect/radio/email/phone) and append them to section array columns.

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FzYJPupeQpsM8YauIqqzf%2Fimage.png?alt=media&#x26;token=b75bcc20-a652-4e2e-88c7-21457115e90b" alt=""><figcaption></figcaption></figure>

### Conclusion     &#x20;

To summarise,

1. We can create input fields as textfield/select/multi-select/radio/email/phone field. Input fields are  those whose values we want to append.
2. We can create output fields as textfields only ( outside the section or inside the section).
3. Input field is a non-array type of field and output field should always be the **array** type field.
