Introducing a new way to review your PRs.

Read the announcement

frappe / insights

Open Source Business Intelligence Tool

View on GitHub

25 documents · Updated Nov 23, 2026

docs / resource-discovery-and-list-filtering

Resource discovery and list filtering

Resource discovery and list filtering help people and agents find the analytical resources they can use. The APIs narrow workbooks, dashboards, stored tables, and resource links by access, text, relationships, and recent use so that selection and navigation start from a useful set of permitted choices. This page extends the data exploration overview and leads into query editor and execution, query utilities, and AI-assisted search.

Discovery surface

The discovery surface serves two related needs. List APIs support navigation through the product's resource libraries, while search APIs support a focused choice inside a link or agent workflow.

Resource categories

The APIs treat each analytical resource as a selectable object with a readable name and context. They cover the main paths from a saved analytical asset to the data that can support a new query.

ResourceDiscovery purpose
WorkbookFind a container for queries, charts, and dashboards.
DashboardFind a saved view for navigation and review.
Stored tableFind a table that is available in the data store.
Query, chart, or dashboard linkChoose a named resource and see its workbook context.
Table columnFind a field for later query building through AI-assisted search.

The list responses also provide context that supports navigation. A workbook can show its data sources and last-opened time. A dashboard can show its favorite state and view count. A stored table can show its source and last sync time. References: insights/…/workbooks.py• L51-93, insights/…/dashboards.py• L53-75, insights/…/data_store.py• L7-48

Access scopes

Access scope is part of discovery, not a later display rule. The default list view keeps resources the user created and resources shared with the user. An administrator can request the remaining resources through the others source.

SourceMeaning
createdResources owned by the current user.
sharedResources granted to the current user by another owner.
othersResources outside the first two groups. Only an administrator can read these through the permission boundary.

This scope keeps a list from naming resources that the caller cannot open. It also gives navigation views a stable meaning when users switch between owned, shared, and broader access lenses. References: insights/…/list_filters.py• L17-38, insights/…/workbooks.py• L52-73, insights/…/dashboards.py• L53-73

List APIs

The list APIs answer which resources should appear in navigation after access scope and list conditions are applied. They return bounded results so the client can load an initial page and request more when needed.

Workbook lists

get_workbooks finds readable workbooks and can narrow them by title, access source, or what they contain. Content conditions can point to a query, chart, dashboard, data source, or table, which lets a user find the container without knowing its title.

The result order favors recently modified workbooks. Each result adds the source names, sharing state, and the user's last-opened time so the client can show why the workbook is useful and how it relates to recent work. The workbook list passes search text and serialized filter conditions from the navigation view to this API. References: insights/…/workbooks.py• L40-93, frontend/…/workbooks.ts• L11-36, frontend/…/WorkbookList.vue• L33-86

Dashboard lists

get_dashboards finds readable dashboards through the same access and content-filter model. It can narrow by dashboard, chart, or data source and separates favorite dashboards from the remaining recent choices.

Favorites are returned as a complete group. The limit applies to the rest of the list. Within the non-favorite group, the user's last-opened dashboards come before dashboards that were only recently modified. This gives direct navigation to known views without hiding them behind the page limit. References: insights/…/dashboards.py• L45-98, frontend/…/dashboards.ts• L24-40, frontend/…/DashboardList.vue• L23-82

Stored table lists

get_data_store_tables finds stored tables that the caller may read. It can narrow the result to one data source and match the search term against the table label or table name.

The API does not present every discovered table as a data-store choice. Only tables marked as stored appear. The response includes the source, database type, and last sync time so later selection can use a table that is present and current enough for the intended analysis. References: insights/…/data_store.py• L7-48, frontend/…/data_store.ts• L16-43

Selection search supports link fields and agent workflows that need a compact set of named analytical resources. It combines the resource title or identifier with the containing workbook title so that equal names remain distinguishable during selection.

Content search helps an agent map business words to readable analytical definitions. It searches workbooks, queries, charts, and dashboards that the caller may read, then returns a short matching passage and downstream usage signals so the agent can favor definitions that are used in visible work. The result is a ranked discovery aid rather than an executable query. References: insights/…/search.py• L43-72, insights/…/search.py• L212-263

search_workbook_items searches queries, charts, or dashboards by title or identifier. It returns the identifier, display title, and workbook title in a compact tuple that a link picker can render as a clear choice.

The endpoint rejects unsupported resource types instead of treating an unrelated document as a selectable analytical item. Empty titles use the same user-facing labels as the workbook editors, so an untitled resource remains understandable in a picker. References: insights/…/search.py• L4-48, insights/…/test_lists.py• L147-159

search_columns turns a term into readable table-column choices for a later query flow. It can search across stored column metadata or within one data source, and it puts exact column names before other substring matches. Tables without synced column metadata are not available to this search.

Column search is a discovery step rather than a query operation. The returned source, table, label, column name, and type give the next query-building step enough context to choose a field without loading every table. See query utilities for the server-side query support that follows selection. References: insights/…/search.py• L74-109, insights/…/insights_table_v3.py• L234-264

Filter contract

List filtering turns a user's visible conditions into a set of permitted resource names. Direct resource fields filter the list itself. Relationship fields first find matching child resources and then keep the parent resources that contain them.

Relationship filters

Relationship filters let a selection workflow ask questions about resource contents rather than only resource metadata. A workbook can be filtered by a selected query, chart, dashboard, data source, or table. A dashboard can be filtered by a chart or data source.

The shared filter rules support exact values, lists of values, pattern matches, and negated forms. A selected table is matched through the data source and table identity recorded by the query, while typed text can match the stored names. This makes a picked table and a typed search term lead to the same parent-resource result. References: insights/…/list_filters.py• L41-127, insights/…/workbooks.py• L40-48, insights/…/dashboards.py• L17-50

Query and navigation handoff

Filtering ends when the system identifies a permitted resource or field. The client then opens that resource or passes the selected table and column into query construction; discovery results are not executable queries.

The handoff keeps navigation and analysis separate. A resource list helps a user choose an existing definition. The query editor and execution and query utilities pages describe how the chosen definition becomes analytical work. References: frontend/…/WorkbookList.vue• L207-255, frontend/…/DashboardList.vue• L152-177, frontend/…/data_store.ts• L19-38, insights/…/search.py• L42-109

Discovery flow

The discovery flow applies access scope before it applies search and content conditions, then returns context for the next navigation or query step. The following diagram shows the shared path across list and selection workflows.

flowchart LR
    U[User or agent need] --> S[Access scope]
    S --> L[Resource list or selection search]
    L --> F[Text and relationship filters]
    F --> C[Permitted resource or field choices]
    C --> N[Open resource or build query]
    N --> X[Query execution or dashboard navigation]

List views keep filter state while a user moves into a resource and returns. A changed source or filter starts a fresh bounded request, while loading more increases the requested limit. This keeps the visible list aligned with the current selection lens. References: frontend/…/workbooks.ts• L14-36, frontend/…/WorkbookList.vue• L56-86, frontend/…/DashboardList.vue• L42-82

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep each list API's accepted filter names aligned with the fields exposed by its picker and list view.
  • Keep relationship matching aligned with the names used inside query operations and with the identity of stored tables.
  • Preserve access filtering for both direct results and related-resource lookups so a hidden child or parent cannot appear through a filter.
  • Keep dashboard favorite and pagination rules aligned so the limit does not hide the promised favorite group.
  • Keep selection result labels aligned with editor wording for untitled queries, charts, and dashboards.
  • Keep stored-table search limited to tables that the data-store workflow can actually use.
  • Keep content-search fields, usage links, and access-limited reads aligned so agent ranking does not expose or mis-rank unavailable definitions.

Important failure modes

TriggerConsequenceGuard
A filter name is added to the UI but not to the matching mapThe server treats it as a direct field or rejects the condition, so the list shows the wrong resourcesUpdate the list contract and its matching definition together
A table filter uses only a display label instead of source and table identityA workbook or query is missed, or an unrelated table is selectedResolve table choices through the stored table identity and its data source
others is requested without the required administrator accessThe caller does not gain visibility into resources outside its grantsKeep source selection subject to the normal permission query
A dashboard limit is applied to favorites and recent items as one groupA favorite dashboard can disappear from the resultKeep favorites outside the count used for the remaining dashboards
Stored column metadata is missing or staleColumn search returns no usable field even though the source table existsTreat column search as metadata discovery and verify the table before query building
Content search reads a definition or usage relation outside the caller's accessAn agent names or ranks a resource the caller cannot useRoute every content and usage read through the caller's readable-resource boundary
A search result is used as an executable queryThe workflow skips resource inspection or query constructionPass the selected resource or field to the query flow described in query editor and execution

Key files

FileWhy to read it
insights/…/list_filters.pyDefines the shared access-source and relationship-filter contract for resource lists.
insights/…/workbooks.pyDefines workbook discovery, content filters, ordering, and returned navigation context.
insights/…/dashboards.pyDefines dashboard discovery, favorite handling, recent ordering, and related filters.
insights/…/data_store.pyDefines the stored-table discovery boundary and search fields.
insights/…/search.pyDefines link search for queries, charts, and dashboards with workbook context.
insights/…/search.pyDefines agent-facing content ranking and column discovery that complements the navigation lists.
frontend/…/WorkbookList.vueShows how workbook access choices and filter fields become list requests.
frontend/…/DashboardList.vueShows how dashboard filters, favorite groups, and bounded loading shape navigation.
insights/…/test_lists.pyStates the access, search, relationship-filter, ordering, and stored-table list guarantees.
docs/data-exploration.mdParent overview for selecting resources and moving into analytical work.
docs/query-editor-and-execution.mdRelated workflow for using a discovered resource or field.
docs/query-utilities.mdRelated server-side support for query construction and execution.
docs/ai-assisted-search.mdRelated agent-facing discovery contract for content and columns.