records_query_from_view()

Query records using the filters and sort order of a saved view. Handy when you've already built the right filter in a view and want a flow to reuse it.

Syntax

records_query_from_view(viewId, limit?)

Parameters

Name Type Required Description
viewId int yes The numeric id of a saved view.
limit int no Max rows to return. Default 1000, clamped to 1–1000.

Returns

A list (array) of records matching the view, in the view's sort order.

Example

$due = records_query_from_view(204, 100);
foreach ( $due as $row ) {
    record_comment("tasks", $row["_meta"]["id"], "Reminder: due soon");
}

Example output

[
    ["title" => "Renew SSL", "due" => "2026-06-15", "_meta" => ["id" => 88, "title" => "Renew SSL"]],
    ...
]

Notes

  • The view id is numeric — find it in the view's URL or settings. The synthesized Default view (id 0) is not accepted.
  • The view's table must be in the flow's workspace scope.
  • Filters that reference fields deleted since the view was saved are silently skipped.

See also: records_query(), Views