Search FlexiRule docs

Recent
Pinned

Press Esc to close. Use arrow keys and Enter inside results. Searches are remembered locally.

FlexiRule Docs

Which Query Mode Should I Use?

Choose the Query Records mode that matches the required result and implementation.

Improve this page

Which Query Mode Should I Use?#

Start with the result your next step needs, not with the longest list of options.

If you need…ChooseWhy
A collection of matching rows with configurable fields, filters, sorting, limit, and offsetFetch RecordsUses the newer Frappe Query Builder path and returns a list of records.
An existing list-style query configurationQuery ListKeeps the legacy query implementation; do not assume its filters or output behave identically to Fetch Records.
One document or a single-record resultQuery DocDesigned for a single target record/result.
Only whether a matching record existsExist RecordAvoids fetching a collection just to answer yes/no.
Output from a supported existing reportQuery ReportUses a Report target and report-specific execution path.
The number of matching recordsCountUse an aggregate mode rather than loading every row.
A total or statistical value for a fieldSum, Average, Min, or MaxSelect the aggregate that matches the question and configure its required field.
Results grouped by a fieldGroup ByUse only grouping behavior supported by the installed implementation.

Prefer the smallest useful result#

If you need yes/no, choose Exist Record. If you need a count or a supported aggregate, prefer that mode to loading a large list. If you need to process each matching row, Fetch Records may be appropriate with a bounded result size and a Loop.

Check the contract and output#

Modes expose different controls and result types. Fetch Records is contractually a List of Records result; Query Doc can expose single-record/full-document output; Exist Record returns yes/no; other modes have their own result behavior.

After configuration, run Debug and inspect the actual result before connecting it to another action. Test empty results, permission-limited results, and realistic maximum data volumes.

→ Query Records overview
→ Fetch Records details
→ Query filters

Last updated Oct 9, 2026