> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-forms/13.latest/developer/extending/adding-a-type/setting-types.md).

# Setting Types

Umbraco Forms field, prevalue source and workflow types are defined in C# and include one or more setting values.

These settings are completed by the editor when using the type on their form.

Each setting type can have it's own user interface. So a string can use a text box but a more complicated JSON structure can use a more appropriate user interface.

The user interface used for a particular setting is defined by the `View` property:

```csharp
[Umbraco.Forms.Core.Attributes.Setting("Message", View = "TextField")]
public string Message { get; set; }
```

## Built-in setting types

The following setting types are available and are used for the field, prevalue source and workflow types that ship with the package.

| Name                     | Description                                                       | Used in                                       |
| ------------------------ | ----------------------------------------------------------------- | --------------------------------------------- |
| Checkbox                 | Uses a single checkbox for entry                                  |                                               |
| DocumentMapper           | Used for selection of a documenttype                              | The "Save as Umbraco node" workflow           |
| Dropdownlist             | Used for selection from a list of options                         |                                               |
| EmailTemplatePicker      | Used for selection of an email template                           | The "Send email with Razor template" workflow |
| FieldMapper              | Used to map fields from a form to required aliases                | The "Send to URL" workflow                    |
| File                     | Used for selection of a file                                      | The "Send email with XSLT template" workflow  |
| MultipleTextString       | Uses multiple text boxes for entry                                | Not used in core types                        |
| NumericField             | Uses numerical text box for entry                                 |                                               |
| Password                 | Uses password text box for entry                                  |                                               |
| PasswordNoAutocomplete   | Uses password text box for entry (with autocomplete disabled)     |                                               |
| Pickers.ContentWithXPath | Uses a content picker with the option for XPath entry             | The "Save as Umbraco node" workflow           |
| Pickers.Datatype         | Uses a datatype picker                                            | The "Umbraco prevalues" prevalue source       |
| Pickers.DocumentType     | Uses a document picker                                            | The "Umbraco nodes" prevalue source           |
| Range                    | Uses a slider for range input                                     | The "reCAPTCHAv3" field type                  |
| RichText                 | Uses a rich text editor for input                                 | The "Send email" workflows                    |
| StandardFieldMapper      | Used to map system fields from a form to required aliases         | The "Send to URL" workflow                    |
| Textarea                 | Used a multiline textbox for entry                                |                                               |
| Textfield                | Used a single-line textbox for entry                              |                                               |
| TextfieldNoAutocomplete  | Used a single-line textbox for entry (with autocomplete disabled) |                                               |
| TextWithFieldPicker      | Used a single-line textbox/form field list for entry              | Not used in core types                        |

All of the above setting types are used in one or more field, prevalue source and workflow types available with Umbraco Forms. For the less common ones, a usage has been indicated in the table.

The two exceptions are "TextWithFieldPicker" and "MultipleTextString". We do not use these two within the package, but we make them available for developers to use when creating their own types.

"TextWithFieldPicker" offers the option of text field entry or selection of a field from the form. This can be useful in workflows where you need to reference the value of a specific field.

![Text with field picker](https://1470284034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHN4dErU7ghf8hOdcQpSs%2Fuploads%2Fgit-blob-bc822cbc599fb465fbd08e7fb19fafeabc546b9c%2Ftext-with-field-picker.png?alt=media)

"MultipleTextString" offers the option of creating multiple text field entries. This can be useful in workflows where you need to provide multiple text values.

![Multiple text string](https://1470284034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHN4dErU7ghf8hOdcQpSs%2Fuploads%2Fgit-blob-28c1f3751b1616892d75f84a6d08b888b14a84e3%2Fmultiple-text-string.png?alt=media)

## Setting properties

Beyond `Name`, `Description`, and `View`, the `Setting` attribute supports other properties.

```csharp
[Setting("My Setting", Description = "Help text for the setting", View = "TextField", SupportsPlaceholders = "true", DisplayOrder = 10)]
public virtual string MySetting { get; set; }
```

* `SupportsPlaceholders` is a flag indicating whether the setting can contain ["magic string" placeholders](/umbraco-forms/13.latest/developer/magic-strings.md) and controls whether they are parsed on rendering.
* `HtmlEncodeReplacedPlaceholderValues` takes effect only if `SupportsPlaceholders` is `true`. It controls whether the replaced placeholder values should be HTML encoded (as is necessary for rendering within content from a rich text editor).
* `SupportsHtml` is a flag indicating whether the setting can contain HTML content. When set to `true` it will be treated as HTML content when the value is read from the Forms delivery API.
* `IsMandatory` if set to `true` will provide client-side validation in the backoffice to ensure the value is completed.
* `DisplayOrder` - controls the order settings appear in relative to each other in the backoffice.

## Translations

Both the `Name` and `Description` of a setting are translatable by providing a [user or package language file](https://docs.umbraco.com/umbraco-cms/extend-your-project/server-side-extensions/language-files) containing appropriate keys:

```xml
<area alias="formProviderFieldTypes">
    <key alias="mySettingName">My Setting</key>
    <key alias="mySettingDescription">Help text for the setting</key>
</area>
```

The area alias to use depends on the provider type the setting belongs to:

* Data sources - `formProviderDataSources`
* Export types - `formProviderExportTypes`
* Field types - `formProviderFieldTypes`
* Prevalue sources - `formProviderPrevalueSources`
* Recordset actions - `formRecordSetActions`
* Workflows - `formProviderWorkflows`

## Default values

Default values for settings can be defined in code using one of two approaches:

### Approach 1: Using a property initializer

```csharp
[Setting("Minimum")]
public virtual string Min { get; set; } = "1";
```

### Approach 2: Using the `DefaultValue` attribute property

```csharp
[Setting("Minimum", DefaultValue = "1")]
public virtual string Min { get; set; }
```

If both are provided, the `DefaultValue` attribute property takes precedence over the property initializer.

These code-based defaults provide an alternative to [configuring default values via `appsettings.json`](/umbraco-forms/13.latest/developer/configuration.md#settingscustomization). If a value is configured in `appsettings.json`, it takes precedence over any code-based default.

## Settings when inheriting

When creating a field or other provider type, you might choose to inherit from an existing class. This could be if one of the types provided with Umbraco Forms almost meets your needs but you want to make some changes.

All setting properties for the Forms provider types are marked as `virtual`, so you can override them and change the setting values:

```csharp
[Setting("My Setting", Description = "My custom help text for the setting", View = "TextField", SupportsPlaceholders = "true", DisplayOrder = 10)]
public override string MySetting { get; set; }
```

If you want to hide a setting in your derived class you can use the `IsHidden` property:

```csharp
[Setting("My Setting", IsHidden = true)]
public override string MySetting { get; set; }
```

## Creating a setting type

To create a custom setting type you will need an AngularJS view and controller in the following location: `/App_Plugins/MyPlugin/`.

{% hint style="info" %}
Your plugin folder path must be outside of the `/App_Plugins/UmbracoForms/` folder if you use a custom Angular controller and Package.manifest.
{% endhint %}

You then add the name of the view as the `View` property on the `Setting` attribute defined on the type.

Umbraco Forms ships with a number of built-in setting views, found in a virtual path of `App_Plugins\UmbracoForms\backoffice\Common\SettingTypes\`. If you want to reference a custom view stored elsewhere, configure the `View` property with a full path to the view, for example,

```csharp
[Setting("My Setting",
    Description = "Help text for the setting",
    View = "~/App_Plugins/UmbracoFormsCustomFields/backoffice/Common/SettingTypes/mycustomsettingfield.html",
    SupportsPlaceholders = true,
    DisplayOrder = 10)]
public virtual string MySetting { get; set; }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.umbraco.com/umbraco-forms/13.latest/developer/extending/adding-a-type/setting-types.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
