# How to set a default field value in a multi-selection field

**URL:** https://discuss.workflowgen.com/t/how-to-set-a-default-field-value-in-a-multi-selection-field/1275
**Category:** Form Designer
**Created:** [January 23, 2019, 5:10pm UTC](https://discuss.workflowgen.com/t/how-to-set-a-default-field-value-in-a-multi-selection-field/1275 "2019-01-23T17:10:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)
#### Post date: [January 23, 2019, 5:10pm UTC](https://discuss.workflowgen.com/t/how-to-set-a-default-field-value-in-a-multi-selection-field/1275/1 "2019-01-23T17:10:11Z")

</div>

In some cases, you might want to set a default value in a multi-selection field (RadioButtonList, CheckBoxList, DropDownListBox, etc.).

Your first instinct might be to simply set a value directly in the Form Designer, but then the value selected by the user will reset to the value you set whenever a new action is launched.

Instead, set the default value either on the **Mapping** screen or in the **.NET editor.**

## Example

In this example, we want to set the value of the **Approval** field to `YES`.

![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/0c579f5bcb84db213309677648fdc65eb3fe5695.png)

First, go to the **Mapping** screen and select the `VALIDATES` action, in which the user selects their approval decision.

 ![Select%20action](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/57c2d293ac8f1d696d24ae4127121e7148cbecf8.gif)

Now, set an IN value for the **Approval** field. There are three ways to set a default value.

#### Method 1: Using a text value

This solution is the easiest to implement, but if you loop back to the **Approval** action, the default value will be used.

To use a text value, click **Value IN** , then set the default value (`YES` in this case) in the **Text** area.

 ![Set%20YES%20text](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/a17e41e5d6108e1c6d7ad32041d18d5f600bf3bd.gif)

#### Method 2: Using an existing data with a default value

In this method, the default value is used only once, and if you loop back you’ll get the updated decision as long as **Data In** and **Data Out** use the same data.

1. On the **Data** tab, create a new data (such as `APPROVAL_DECISION`), and set the **Default value** text field to `YES`.

2. Return to the **Mapping** screen and select the **Approval** action.

3. Click **Value IN** , then select `APPROVAL_DECISION`.

4. To save the value selected by the user, set `APPROVAL_DECISION` to `OUT`.

#### Method 3: Using .NET code-behind

Another solution is to use the .NET editor.

**Sample code**

```auto
 protected void Page_Load(object sender, EventArgs e)
    {
        if(CurrentWorkflowActionName == "VALIDATES"){
           APPROVAL_DECISION.SelectedValue == "YES";
        }
    }

```

**Note:** Be careful if you loop back to the `VALIDATES` action, because the selected value will always reset to `YES`.

### Result

Now, when the system launches the `VALIDATES` action, the **Approval** field’s default selected value is `YES`.

![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/10a2f27dd858292ddf685edb8719fbedc4f3bc4b.png)
