Skip to content

Entry field references

Field reference is a special piece of text that will be replaced by a value from another entry. This is similar to how a spreadsheet cell can get and combine data from other cells.

Field references are useful when you need the same piece of data appear in different entries. For example, if your company uses single sign-on and you use the same credentials — your work account — to sign into different web services. Instead of copying your password to each entry, you can insert references to the "main" work account:

Screenshot
Main account and references

Whenever you change the main entry's password, all the entries referring to it will update automatically.

Creating a field reference

The best way to create a reference to a field is to tap that field, then tap Copy Field Reference button in the popup.

Screenshot

This way, the reference to that field will be copied to clipboard, so you can use that reference in any other field of any other entry.

Alternatively, you can construct the reference manually using the field reference format documented below.

Using field references

Field references can be used to any field of any entry, you can paste them from clipboard as any other text. While you edit the entry, it will show the raw text of the reference, which is far from intuitive.

Screenshot

As soon as you save the entry, the complicated reference text will be replaced by the value it points to.

Field references are resolved whenever you load or save the database. That's why it is impossible to refer to dynamic values such as OTP. However, you can create a reference to the OTP configuration field and your entry would independently generate the same OTP values.

TIP

KeePassium supports nested references, where Field C includes a reference to Field B which, in turn, refers to Field A. The app will go up to 3 references deep to resolve the field value.

If there is any problem with a field reference, it will be shown in its raw {REF:…} form. Possible issues include:

  • Misformatted reference
  • Reference to non-existent entry or field
  • Reference is used outside of an entry
  • Nested reference goes too deep
  • Nested reference is looped (field value eventually refers to itself)

Entries only

Field references won't work outside of entry fields.

Same database only

Field references work only within the same database. To speed up access to other databases, use linked databases.

Field reference format

Behind the scenes, a field reference is a plain-text expression formatted as follows:

{REF:fieldIdentifier@entrySearchCondition}

For better readability, here is the same expression with extra spaces:

{REF: fieldIdentifier @ entrySearchCondition }

The reference corresponds to five main criteria:

  • It is wrapped in { curly brackets }
  • It starts with REF: prefix
  • It contains a field identifier — a single letter that defines which field we are referring to.
  • The field identifier is followed by the @ separator symbol
  • After the separator, there is an entry search condition — an expression that identifies the entry we are referring to.

Field identifier

Field identifier can be one of these letters:

  • T — Title
  • U — Username
  • P — Password
  • A — URL
  • N — Notes

For example {REF:P@ … } means we want to get the password value of the entry.

Entry search condition

The entry search condition is an expression by itself. It contains a field identifier letter, a : separator, and exact value of the specified field. For example, T:My Work Account refers to the first entry titled exactly "My Work Account".

Entry search condition supports more field identifiers:

  • T — Title
  • U — Username
  • P — Password
  • A — URL
  • N — Notes
  • I — UUID. The search value should be the unique identifier of the entry. You can find this value in the last tab of the entry viewer.
  • O — Custom field. The search value is the name of the custom field. This is in contrast to other fields, where the search value is compared to field values.

Examples

  • {REF:U@I:327FCC13-07F5-4AB4-97D9-78486148B729} — find an entry with the given UUID and get its username field.
  • {REF:P@T:Amazon} — find an entry titled "Amazon" and get its password field.
  • {REF:T@O:PIN Code} — find an entry with a custom field named "PIN Code", and get its title field.

Placeholders

A placeholder is a simplified reference to another field of the same entry. KeePassium supports one placeholder format: {S:fieldName}.

For example, text {S:PIN code} would be replaced by the value of the custom field named "PIN Code", if there is one.

TIP

Standard fields are named Title, UserName, Password, URL, Notes. Letter case is important: username or Username won't work.

Compatibility

KeePassium field references are compatible with KeePass and KeePassXC. References created by KeePassium will work in those apps and vice versa.

However, KeePassium does not support most of entry placeholders available in those apps, mainly due to minimal demand. The only supported placeholder is {S:fieldName}, which refers to another field of the same entry.