> For the complete documentation index, see [llms.txt](https://codifi-fdm.gitbook.io/codifi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codifi-fdm.gitbook.io/codifi-docs/cross-platform-features/ripple/visibility-formulas.md).

# Visibility Formulas

Visibility formulas control whether a field or an entire section is shown to the user. This keeps forms clean and relevant — users only see the fields that apply to their current data-entry context.

## How It Works

When a visibility formula evaluates to `true`, the field or section is **shown**. When it evaluates to `false`, the field or section is **hidden**. Hidden fields **retain their data** — they're just not visible. If the formula later evaluates to `true` again, the previously entered data is still there.

***

## Common Conditions

| Condition Type | Description                       | Example                                                          |
| -------------- | --------------------------------- | ---------------------------------------------------------------- |
| Equals         | Show when a field matches a value | Show *Period* when Type = "Historic"                             |
| Not Equals     | Show when a field doesn't match   | Hide *N/A* section when Status ≠ "Closed"                        |
| Contains       | Show when text includes a keyword | Show *Lithic Details* if Materials contains "Lithic"             |
| Is Empty       | Show when a field has no value    | Show *Please fill in* prompt when Name is empty                  |
| Is Not Empty   | Show when a field has a value     | Show *Summary* section once Title is entered                     |
| Greater Than   | Numeric comparisons               | Show *High Density* alert when Count > 100                       |
| Multiple AND   | All conditions must be true       | Show when Type = "Site" **AND** Status = "Active"                |
| Multiple OR    | Any condition can be true         | Show when Type = "Historic" **OR** Type = "Multi-component"      |
| Nested logic   | Complex combinations              | Show when (Type = "Historic" AND Period ≠ "") OR Override = true |

***

## Example: Prehistoric vs. Historic Field Switching

One of the most common CRM patterns — show different fields based on temporal affiliation.

**Setup:**

* *Temporal Affiliation* dropdown: `Prehistoric | Historic | Multi-component`

**Visibility rules:**

| Field / Section                              | Shown when                                                    |
| -------------------------------------------- | ------------------------------------------------------------- |
| *Prehistoric Culture* field                  | Temporal Affiliation = "Prehistoric" **OR** "Multi-component" |
| *Historic Period* field                      | Temporal Affiliation = "Historic" **OR** "Multi-component"    |
| *Historic Function* section (entire section) | Temporal Affiliation = "Historic" **OR** "Multi-component"    |

**Result:**

* Select "Prehistoric" → see culture fields.
* Select "Historic" → see period and function fields.
* Select "Multi-component" → see both.

***

## Example: Progressive Disclosure for Site Recording

Reveal more detailed sections as the user fills in initial information. This guides users through the form step by step instead of overwhelming them with dozens of fields at once.

| Section                 | Shown when               |
| ----------------------- | ------------------------ |
| *Basic Info*            | Always visible           |
| *Site Description*      | Site Name is not empty   |
| *Environmental Setting* | Site Type is selected    |
| *Condition Assessment*  | `completionPercent > 50` |
| *Recommendations*       | `completionPercent > 75` |

{% hint style="info" %}
`completionPercent` returns a value from **0 to 100** (not 0 to 1). So `> 50` means more than half of the Record's required fields are filled in.
{% endhint %}

***

## Tips for Visibility Formulas

* **Visibility formulas can reference any field** in the Record, including [calculated fields](/codifi-docs/cross-platform-features/ripple/value-formulas.md) and fields from parent Records. You can show or hide sections based on parent-site type or Project-level settings.
* **Hiding a field doesn't delete its data.** If a previously hidden field becomes visible again, the previously entered value is still there.
* **Keep trigger fields visible.** A field that controls visibility of other sections should be in an always-visible section. If the trigger field itself is hidden, the fields it controls can't respond to changes.
* **Test with empty data.** Visibility rules are evaluated even when fields are empty. Use `isEmpty()` checks to avoid showing partial sections before the user has entered data.
* **Visibility rules apply at the section AND field level.** A hidden section hides all fields within it.

***

## See Also

* [Value Formulas](/codifi-docs/cross-platform-features/ripple/value-formulas.md) — compute field values automatically
* [Real-World Examples](/codifi-docs/cross-platform-features/ripple/examples.md#status-driven-data-triggers) — Status-driven field reveal patterns
* [Operations Reference](/codifi-docs/cross-platform-features/ripple/reference.md#logic--comparison) — every comparison and logic operator
