Self-Service Analytics and Saved Views
Business intelligence in traditional web frameworks is almost always an afterthought. Teams start by executing ad-hoc SQL queries, progress to building custom admin dashboards, and eventually hit a wall when users demand preset list filters, automated PDF/Excel email dispatches, and external BI tool integrations like Metabase or Apache Superset.
In Framework M, analytics and reporting are first-class, metadata-driven primitives. With our recent July updates, we introduced Saved Views, automated AutoReport background jobs, direct email queue delivery, and Shadow Table Resolvers that let external BI engines query dynamic DocType schema structures safely.
The Self-Service Spectrum: From Saved Views to External BI
Framework M divides user analytics into three seamless tiers:
┌─────────────────────────────────────────────────────────────────────────┐
│ Framework M Analytics Stack │
├──────────────────────────────┬───────────────────────────┬──────────────┤
│ Tier 1: In-App Preset Views │ Tier 2: Scheduled Reports │ Tier 3: BI │
│ SavedView & ListView Filters │ AutoReport & TaskIQ Jobs │ Shadow Tables│
└──────────────────────────────┴───────────────────────────┴──────────────┘
- In-App Preset Views: Operational users save custom list column layouts, sort orders, and complex filter criteria into reusable
SavedViewDocTypes. - Scheduled Dispatch: Supervisors convert any
SavedViewor standard Report into anAutoReport, dispatching recurring reports via TaskIQ workers and background email queues. - External BI Federation: Data analysts plug tools like Metabase or Superset directly into Framework M via Shadow Tables and
VirtualDocTypeResolverwithout breaking multi-tenant security boundaries.
1. Saved Views & Preset Filters in Desk
Every user in Framework M Desk can filter, sort, and re-order columns on any DocType ListView. Previously, these filter states disappeared when navigating away.
With the SavedView DocType and SavedViewListView interface, users can name and persist their filter combinations:
{
"doctype": "SavedView",
"name": "high-priority-tickets",
"reference_doctype": "Support Ticket",
"user": "alice@example.com",
"filters_json": "[[\"status\", \"=\", \"Open\"], [\"priority\", \"=\", \"Urgent\"]]",
"sort_by": "creation",
"sort_order": "desc",
"is_public": true
}
Public saved views allow team leaders to create canonical views—such as "Q3 Unassigned Leads" or "Pending Approvals"—that appear in the left sidebar for all team members automatically.
2. Automated Scheduled Reports (AutoReport)
Building background email reports manually usually involves writing custom cron jobs, rendering templates, attaching files, and handling SMTP retries.
Framework M standardizes this workflow through the AutoReport DocType and TaskIQ background workers:
from framework_m_core.doctypes.auto_report import AutoReport
# Configure an automated weekly status report
auto_report = AutoReport(
report_name="Weekly Operations Summary",
reference_doctype="Project Task",
saved_view="overdue-tasks",
frequency="Weekly",
send_to="ops-team@example.com",
format="PDF",
enabled=True,
)
await auto_report.insert()
Background Worker Lifecycle
- Dispatcher:
auto_report_dispatcherevaluates cron schedules and locks running jobs via TaskIQ locks to prevent duplicate executions across HA worker nodes. - Worker:
auto_report_workergenerates the underlying dataset viaVirtualDocTypeResolver, renders HTML/PDF or CSV formats, and pushes the payload to the directemail_queue.
3. Connecting External BI Tools with Shadow Tables
Connecting tools like Metabase or Superset directly to application databases often breaks down when DocTypes use dynamic JSON attributes, virtual fields, or multi-tenant database partitions.
Framework M solves this with Shadow Table Routes (/api/v1/analytics/shadow-table) and the VirtualDocTypeResolver:
The VirtualDocTypeResolver dynamically translates external BI queries into optimized native SQL queries across SQLite, PostgreSQL, MySQL, MariaDB, Oracle, or SQL Server while enforcing tenant RLS boundary filters.
Getting Started
To explore external BI integration and scheduled reporting in your application, check out the official how-to guide:

