This article describes how to add a default value to a Field.
You can add a default value to a Field using one of the following methods:
- Assigning an explicit value, which is a single value specified by you. This is useful when there is only value that you expect.
- Using a Formula to automatically generate a calculated value. This is useful when the expected value can vary depending on the context (for example, values that depend on values entered in other Fields).
Adding an explicit default value
- Navigate to the Databases.
If you do not yet have a Database, add one. - Select the Form in which you want to add a default value for.
- Click “Form settings” in the upper right corner.
- Click on any supported Field type for default field values:
- Text, multi-line text, Quantity, Date: Option to choose from value or from formula
- Single select field: Choose by ticking the default field values option out of the options for the single select field
- Multiple selection field: Choose by ticking the multiple default field values out of the options for the multiple selection field
- Reference field: select default value from current lists of reference records
- Geographic point: specify the geolocation accuracy under “Required geo-location accuracy” and add the default field values into the Latitude and Longitude options.
- Week, Fortnight, Month: select a default value from the calendar
- User: select a default value from the list of users(?), clear value if you click on the wrong thing
- Select a Field type and fill in the Field values and Properties.
In this example, we continue by selecting a Quantity field, and naming it "Number of Items."
We want new records to have a default value of 10. - Choose the “From value” option to provide an explicit value (in this example: 10).
- Type in the default value, and click “Done.”
- Click “Save” to apply the changes to the Form.
The default value is defined for the Field.
In this example, when users add new Records, the Quantity field is pre-filled with the default value of 10.
Using Formulas to generate the default value
You can also use Formulas to define the default value of a Field. Continuing with the same example, we are using a Quantity field for the following steps:
- Select the Field to which you wish to add a default value from a Formula.
The following Field types do not support default value formulas:
- Geopoint
- Week
- Fortnight
- Month
- Single selection
- Multiple selection
- Reference
- User
- Choose the option “from Formula” to provide a Formula that would return a value automatically.
- Under “Default value” click in the text box that says “Enter your formula here.”
- Add the expression for your Formula. Use the codes you assigned to the Fields you need.
Make sure your Formula is verified.
- Alternatively, click on "Formula editor" and follow the steps outlined in the Formula editor article.
For more information on all the available Formulas, see the Formulas Manual. Also, learn more about writing a formula in the context of a record.
- Click on "Done" to add the Field.
- Click "Done" and then "Save" to save the changes to the Form.
You added a default value to a Field.