Docs‎ > ‎Logic Designer‎ > ‎Live Logic‎ > ‎

findWhere

Returns a filtered, sorted collection.

Example

The following is used in the allocation example:

 SysLogic.findWhere(
    row.paymentCustomer.ordersList,  // input collection
    "row.amount_un_paid > 0",        // filter
    "placed_date a")                 // sort 

Parameters:
  1. The input collection (often a child accessor, as shown here for payments)
  2. filter
  3. sort

Performance

This construct queries the input collection from the database, and performs an in-memory filter/sort.
  • It is an excellent choice if the input collection is small, or is re-used in the transaction (since it leverages the transaction cache)
  • It is a poor choice if the input collection is very large.  In such cases, use a SQL Select.