Logic Composer
Validation set
Check several named rules together and report the first failure or every failure.
A validation set groups related rules into one block. Each rule has a name and a Yes/No condition. When the set runs, it tells you whether all rules passed and which ones failed, either just the first failure or every failure. Use it to check that a record is ready for a step in its life, such as “a quote is ready to send” or “a case can be closed”, and tell the user everything that still needs fixing.
Build a validation set
Section titled “Build a validation set”- Create a logic block and choose the Validation set card. See Create a logic block.
- Add inputs on the Input tab, and rows or queries on the Data tab.
- On the Validation Set tab, select Add rule. Enter a Name and build a Yes/No Condition that is Yes when the data is valid. Rule names must be unique in the set.
- Repeat for each rule.
- Drag rules to set the order they run in (“Drag to change the order”). Use Edit rule, View rule or Remove rule on each row as needed.
- Set Return First Validation Error.
- Save, then select Run with data that breaks several rules at once.
Settings
Section titled “Settings”| Setting | What it does | Notes |
|---|---|---|
| Rules | The named checks, in run order. | Each has a Name and a Condition. |
| Return First Validation Error | On: the rules run in the order shown and stop at the first one that fails. Off: every rule runs and every failing rule is reported. | Changes which outputs the block has. |
Outputs
Section titled “Outputs”| Output | Type | When it exists | Value |
|---|---|---|---|
isValid |
Yes/No | Always | Yes when every rule passed. |
failedValidation |
Text | Return First Validation Error on | The name of the first rule that failed; empty when all passed. |
failedValidations |
List of Text | Return First Validation Error off | The names of all rules that failed. |
How it behaves
Section titled “How it behaves”- Return First Validation Error on. Rules run top to bottom. The first rule whose condition is No stops the set; later rules do not run. Put basic rules first, such as “the quote has a customer”, so later rules can rely on them without checking for empty values again.
- Return First Validation Error off. Every rule runs, whatever the others return. Use this when users should see all problems at once.
- In a recipe’s Validation stage, a failed set cancels the create, update or delete. The message the user sees is the names of the failed rules, one per line. Name rules as the sentences you want users to read.
- In an expression or flow, read
isValidto decide what to do, andfailedValidationorfailedValidationsto build your own message, for example with Join to combine the names. - Empty values follow the expression rules: an empty number counts as 0 and an empty Yes/No counts as No. See Empty values.
Example: quote ready to send
Section titled “Example: quote ready to send”Inputs: QuoteId (Lookup to Quote)
Data: the quote with its customer, price list, total amount and expiry date.
Return First Validation Error: off
| # | Rule name | Condition |
|---|---|---|
| 1 | The quote must have a customer |
Not Null(Quote.customerid) |
| 2 | The quote must have a price list |
Not Null(Quote.pricelevelid) |
| 3 | The quote must have a name |
Not Null Or Empty String(Quote.name) |
| 4 | The total must be greater than zero |
Quote.totalamount > 0 |
| 5 | The expiry date must be in the future |
Quote.expireson > Now |
A rep saves a quote that has a customer but no price list, a total of zero and an expiry date last week. With the set in a recipe’s Validation stage on Quote Update, the save is cancelled and the rep sees:
The quote must have a price listThe total must be greater than zeroThe expiry date must be in the futureisValid is No and failedValidations holds the same three names. With Return First Validation Error on, the rep would see only The quote must have a price list, and failedValidation would hold that name.