Formula Check examples
Use these examples to build Record Health Checks with the Verify with a formula Evaluation Type. A formula Check passes when a Salesforce formula on the open record returns true. Choose it when every value the requirement needs is a field on the record or on a parent record, such as the Account’s Parent Account or Owner.
Each example is a set of instructions; the package does not install these Checks. You create each one in Setup, in Custom Metadata Types → Record Health Check → Manage Records.
Choose an example
Section titled “Choose an example”| Example | Question it answers | What it teaches |
|---|---|---|
| Check that an Account has a Phone or Website | Does the Account have a Phone or a Website? | OR() to accept either of two fields, and an edit link |
| Check that the billing address is complete | Are Billing City, State, and Country all populated? | AND() to require several fields, and a Found formula that names what is missing |
| Check partner Accounts for a billing country | Does a channel partner Account have a Billing Country? | An applicability formula that produces Skipped, and a count-only summary of passed Checks |
| Check the parent Account’s headquarters city | Does the parent Account have a Billing City? | A parent relationship field, and a link to the parent record |
| Check that an Account meets a minimum employee count | Is Employees at least 10? | A number comparison, with Found and Expected on every row |
Fields every formula Check uses
Section titled “Fields every formula Check uses”| Field | What to enter |
|---|---|
| Evaluation Type | Verify with a formula |
| Pass Condition | A Salesforce formula that returns true to pass and false to fail, such as NOT(ISBLANK(BillingCity)) |
| Applies To | All records, or When a formula is true with an Applies When (Formula) that decides when the Check is skipped |
| Display: Found Formula, Display: Expected Formula | Optional formulas whose results the card shows as Found and Expected. They never change the result. |
In a formula, ISBLANK() tests whether a field is empty, NOT() reverses true and false, AND()
requires every condition, and OR() requires at least one. Write field API names, such as
BillingCity, and put fixed text in quotation marks.
Without display formulas, a formula Check shows no Found and Expected values to most users. Users directly assigned Record Health Check Admin or Record Health Check Diagnostics Viewer see Expected with the Pass Condition formula itself.
Know when to choose another Evaluation Type
Section titled “Know when to choose another Evaluation Type”A formula cannot read child records, such as an Account’s Contacts or Opportunities. Use a Query example for related records, a Compare two queries example when two lists or counts must agree, or an Apex example when the rule needs custom logic.
A formula reads data with the running user’s access. If the user cannot read a field in the formula, the Check shows Unable to Check rather than a guessed result, so test with the access of the people who will use the card.