Skip to content
flowon.com

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.

  1. Create a logic block and choose the Validation set card. See Create a logic block.
  2. Add inputs on the Input tab, and rows or queries on the Data tab.
  3. 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.
  4. Repeat for each rule.
  5. 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.
  6. Set Return First Validation Error.
  7. Save, then select Run with data that breaks several rules at once.
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.
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.
  • 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 isValid to decide what to do, and failedValidation or failedValidations to 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.

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 list
The total must be greater than zero
The expiry date must be in the future

isValid 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.