Conditional Fields
In this article we cover fields that only appear when they apply: how to set one up, how Cubrel treats a hidden field when you save, and the conditional fields Cubrel ships with.
What a conditional field is
Some fields only make sense in certain situations. A meeting link matters for online meetings, a lost reason only for lost deals. A conditional field shows on a record only while other fields of the same record have certain values. Everywhere else it stays out of the way, so forms stay short.
The condition only affects record pages: creating, editing, and viewing a record. Lists, filters, exports, imports, bulk updates, and the REST API treat a conditional field like any other field.
Setting a condition (admins)
Open the field under Workspace > Modules Manager > [module] > Fields, or add it in the Module Builder, and turn on Conditional Visibility.
- Under Show this field only when, pick another field of the same module, an operator, and a value. For example: Meeting Type is Online.
- Click Add condition to add more. With more than one condition, choose under Match whether ALL of them or ANY of them must be true.
- Decide whether to Clear the value when this field is hidden (on by default, see below).
- Save the field.
The operators depend on the type of the field you pick, the same as in list filters: is, is not, contains, does not contain, starts with, greater than, less than, between, before, after, is empty, and is not empty.
A field can't depend on itself, and conditions can't form a loop (field A depends on B, and B on A). Cubrel tells you when you try. If you delete a field, conditions that depended on it are removed.
What users see
On a record page, the field appears and disappears as the controlling fields change, right while you're filling in the form. A section whose fields are all hidden is hidden too.
Required fields that are hidden
A required field is only required while it's visible. If its condition hides it, the record saves without it. Cubrel applies this rule on every path that writes records: record forms, quick create, imports, workflows, Ask Cubrel, and the REST API.
Clearing hidden values
With Clear the value when this field is hidden on, a field that's hidden when the record is saved loses its value. This keeps lists and exports consistent: a deal that's no longer lost shouldn't keep a lost reason.
If you switch the controlling field back before saving, the value comes back. Turn the option off to keep values even while the field is hidden.
Conditional fields Cubrel ships with
| Module | Field | Shows when |
|---|---|---|
| Meetings | Location | Meeting Type is In Person or Hybrid |
| Meetings | Meeting URL | Meeting Type is Online or Hybrid |
| Cases | Closed At | Status is Closed or Rejected |
| Cases | Resolution | Status is Closed |
| Deals | Probability | The deal isn't Closed Won or Closed Lost |
| Deals | Expected Close Date | The stage isn't Prospecting |
| Deals | Lost Reason | The stage is Closed Lost |
| Deals | Next Step | The deal isn't Closed Won or Closed Lost |
| Deals | Won On | The stage is Closed Won |
| Leads | Source Detail | Lead Source is Referral, Partner or Other |
| Leads | Unqualified Reason | Status is Unqualified |
| Leads | Converted On | Status is Converted |
| Contacts | Consent Date | Marketing Consent is checked |
| Orders | Shipped On, Tracking Number | Status is Completed |
| Quotes | Valid Until | Status is Draft or Sent |
| Quotes | Accepted On | Status is Accepted |
| Quotes | Decline Reason | Status is Rejected |
| Tasks | Completed At | Status is Completed |
| Documents | Template, Source Module, Source Record, Checksum | Origin is Generated |
You can change or remove these conditions like any other.
In short
| Question | Answer |
|---|---|
| Where do I set a condition? | On the field, under Conditional Visibility |
| Can a condition use several fields? | Yes, matched as ALL or ANY |
| Does it hide the field in lists and exports? | No, only on record pages |
| Is a hidden required field still required? | No, only while it's visible |
| What happens to a hidden field's value? | It's cleared on save, unless you turn that off |
| Can a field depend on itself? | No, and conditions can't form a loop |