--- title: "What are field keys and how do you use them?" slug: "what-are-field-keys-and-how-do-you-use-them" updated: 2026-09-28T06:23:24Z published: 2026-09-28T06:23:24Z canonical: "help.quickbase.com/what-are-field-keys-and-how-do-you-use-them" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.quickbase.com/llms.txt > Use this file to discover all available pages before exploring further. # What are field keys and how do you use them? ## What is a field key? A **field key** is a unique identifier that is assigned to each field within a form. Field keys are used to reference a field in submission data, as well as in [field rules](/fastfield/docs/field-rules-and-skip-logic) (e.g., skip logic) and [calculations](/fastfield/docs/the-calculation-field). All fields have field keys by default, which you can rename and edit manually. They are limited to **letters**, **numbers**, and **underscores** -- making it easier to type and remember them. You can find the field key for each field in the **General Settings** menu of the Form Builder. You can also select **Show Field Keys** (under the Preview button) to view each field key directly in the form. ![Form Builder General Settings menu showing the Show Field Keys option](https://cdn.document360.io/dd260e4e-10bb-4b66-8fb3-5504c272b904/Images/Documentation/5473884472973?sv=2026-02-06&spr=https&st=2026-10-31T06%3A28%3A48Z&se=2026-10-31T07%3A28%3A48Z&sr=c&sp=r&sig=Lojpr775TDEtGktxdxyFCNkhnYsZAQnXQxsRAnmRBU4%3D) ## What do field keys do? Field keys are used in internal form logic, automated workflows, and advanced calculations. It is best practice to organize your form fields to accurately reflect your submission data across all similar forms within your account. ## Use field keys with skip logic and rules FastField supports [skip logic and embedded rules](/fastfield/docs/field-rules-and-skip-logic) in forms. You can write rules to perform the following actions: - Hide or show fields - Hide or show form sections - Set fields as required or not required - Enable or disable fields - Other custom calculations FastField can perform conditional "if/then" logic through the power of a JavaScript execution engine while referencing field keys. To set up a rule for a specific field, select the **Rules** button next to the field you'd like to apply logic to. To set up form-level rules that involve multiple fields, go to **Advanced Options** > **Advanced** **Rules.** Once you're in the Field Rules or Form Rules window, you'll be able to create your rules scripts. When using field keys within a calculation field, make sure to surround the field keys with **$** signs. For example: **$Cost$ - $Quantity$** ### Reference field values in rules To access a **field value** in a rule condition, wrap the field key with the **$** character. For example, for a field with a field key of *first_name*, you would use the following syntax to check if the first name is *John*. ```plaintext if ($first_name$ == 'John') ``` ### Built-in functions FastField supports built-in functions in addition to the standard functions that you will find in the JavaScript library. The following functions can be used to interact with the form model: - **hide(optional fieldKey)** — hide a field. If the field key is not specified, the field that the script is written for will be used. - **show(optional fieldKey)** — show a field. If the field key is not specified, the field that the script is written for will be used. - **hideSection(optional sectionKey)** — hides an entire section. If the section key is not provided, the current section will be used. - **showSection(optional sectionKey)** — shows an entire section. If the section key is not provided, the current section will be used. - **required (optional fieldKey)** — sets a field as required. If the field key is not specified, the field that the script is written for will be used. - **notRequired(optional fieldKey)** — sets a field as not required. If the field key is not specified, the field that the script is written for will be used. - **disable(optional fieldKey)** — sets a field as disabled. If the field key is not specified, the field that the script is written for will be used. - **enable(optional fieldKey)** — sets a field as enabled. If the field key is not specified, the field that the script is written for will be used. - **float(value, emptyVal)** — safely converts a value to a float - **string(value)** — converts value to a string - **integer(value, emptyVal)** — safely converts a value to an integer - **bool(value)** — safely converts a value to a boolean (true/false) - **listContainsValues($list_field_key$, ['value 1', 'value 2'])** — checks if the list from a List Selector field contains a set of values - **listContainsValue($list_field_key$, ['value'])** — checks if the list from a List Selector field contains a single value - **sumSubform($subform$, 'field key')** — sums all the values of a field key within all instances of a particular subform - **hideOnReport('fieldKey')** — conditionally hide a field from the default reports. If the field key is not specified, the field that the script is written for will be used. - **showOnReport('fieldKey')** — conditionally show a field on the default reports. If the field key is not specified, the field that the script is written for will be used. ### Example scripts **Hiding/Showing Fields** To hide a field through the script, the **hide** built-in function can be used. The following example illustrates how to hide the field if the *married* switch field is set to *true* (Yes): ```plaintext if ($married$ == true)    show(); else    hide(); ``` **Specifying Field Keys to Hide and/or Show Fields** The following example illustrates how to hide two fields with the same rule: ```plaintext if ($married$ == true) {        show('spouse_name');        show('spouse_age'); }    else {        hide('spouse_name');        hide('spouse_age'); } ``` **Hiding/Showing Form Sections** To hide a section within a form through the script, the **hideSection** built-in function can be used. The following example illustrates how to hide the section if the field with the field key of *first_name* is equal to *Sam:* ```plaintext if ($first_name$ == 'Sam')    hideSection(); else    showSection(); ``` In this example, all fields in the active section will be hidden when the first name is equal to *Sam*, and conversely, all fields will be visible if the first name is not equal to *Sam*. **Specifying Field Keys to Hide and/or Show Fields** To hide a specific section, you can pass the section key as a parameter to the **hideSection** function. The following example illustrates how to show/hide two sections with the same rule: ```plaintext if ($have_children$ == true) { showSection('children_data'); showSection('marriage_data'); } else { hideSection('children_data'); hideSection('marriage_data'); } ``` **Checking for Values in List** To check if a List Selector contains values, you can use the **list contains values** function. The following example illustrates how to write these rules: ```plaintext if (listContainsValues($favorite_color$,['red']) && $age$ > 25) { show(); } else { hide(); } ``` In this example, the field is shown if the favorite color selected is *red* and the age is greater than 25. **Performing Calculations in Rules** You may also perform calculations such as: ```plaintext int total = 0; if ($married$ == true) {    total = $required_deposit$ * 2.0; } else {    total = $required_deposit$; } if (total > 50) {    required(); } else {    notRequired(); } ``` In this example, the total is increased by 2X the required deposit if the individual is married.