3.5 KiB
layout, title, categories, featured, popular, tags, order
| layout | title | categories | featured | popular | tags | order | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| article | Custom Fields |
|
false | false |
|
08 |
Custom fields, available for any [Vault item type]({% link _articles/account/managing-items.md %}), allow you to store additional well-structured data fields for a Vault item. Custom fields are saved as Name:Value pairs, and can be one of three types:
- Text: Field value stores a freeform input (text, numbers, etc.)
- Hidden: Field value stores freeform input that is hidden from view (particularly useful for Organizations using the Hide Password access control).
- Boolean: Field value stores a boolean value (true/false).
Auto-fill Custom Fields
The Name specified for a custom field is critical to successfully setting up auto-fill for custom fields. When naming the custom field, you should use one of the following HTML form element attributes/values:
- HTML form element's
idattribute. - HTML form element's
nameattribute. - HTML form element's corresponding
labelvalue. - HTML form element's
aria-labelattribute. - HTML form element's
placeholderattribute.
Bitwarden will search the matched-URI webpage for those HTML form element attributes/values in the above priority-order. If a custom field's name matches one of those attributes/values, auto-fill will be available into that HTML form element.
Name to Attribute Matching
Field Name to attribute/value matches is exact and case-insensitive comparison. For example, if your custom field has the name PIN:
- Auto-fill offered for
pin,PiN,PIN, etc. - Auto-fill not offered for
pin2ormypin
Field Name Prefixing
There are two cases in which you can exercise more control over name to attribute mapping by using prefixes.
csv
Prefixing your custom field's name with csv= allows you to specify multiple names to search for and compare to when auto-fill is performed. For example:
csv=pin,pin2,mypin will offer auto-fill for all the above examples.
regex
Prefixing your custom field's name with regex= allows you to perform regular expression comparisons{:target="_blank"} when auto-fill is performed. For example:
regex=pin will offer auto-fill for all the above examples.
regex=^first.*name will offer auto-fill for firstName, First_name, and First Name
Example Auto-fill Configuration
Follow this procedure to correctly configure a custom field for auto-fill. This example uses Google Chrome for its Developer Tools.
{% image /features/custom-fields/custom_field.gif %}
-
On the webpage that matches the Login item's URI, right-click the field you want to auto-fill to and select Inspect.
The HTML element will open and be highlighted in the Developer Console.
-
Find and copy the element
id(findid="xxx", wherexxxis the element'sidvalue). -
In the relevant Vault item's Custom Fields section, choose the appropriate field type and select the {% icon fa-plus %} New Custom Field button:
{% image /features/custom-fields/types.png Select custom field type%}
-
Paste the copied element
idin the Name field. -
Specify the desired information to be auto-filled (in the above example, a PIN) in the Value field.
{% image /features/custom-fields/custom-field-eg.png Custom field example %}
-
Save the Vault item.