Metric
Definition
The Metric Widget in Zenphi Dashboards is a powerful visual component designed to display a single numeric value derived from a Zenphi Table. Whether you're tracking totals, averages, counts, or other calculated figures, the Metric Widget gives you a clean, real-time snapshot of your most important KPIs.
At its core, this widget aggregates data using a specific field and function — such as counting records, summing values, or calculating averages — and visually highlights the result. It's ideal for summarizing large data sets into a single, easily digestible figure that can drive quick decisions or track performance over time.
Key Capabilities
- Pull data dynamically from any Zenphi Table.
- Apply aggregation functions like Count, Sum, Average, Min, or Max.
- Add custom styling, including prefixes, suffixes, and precision (e.g., "$12.00", "95%", "3.14").
- Filter records based on flexible, rule-based conditions.
- Real-time updates ensure your displayed metrics reflect the latest data.
This widget is especially useful in executive dashboards, operational reports, or any situation where you need a high-level number to represent your current status, progress, or total volume.
Example Use Cases
The Metric Widget in Zenphi Dashboards is ideal for displaying key numerical insights at a glance. Whether you're tracking performance, monitoring workflow statuses, or presenting live KPIs, Metric Widgets help you highlight the data that matters most — clearly and in real time.
1. Total Number of Active Requests
Use this widget to count the total number of workflow requests currently in the "Active" state. By filtering your table’s "Status" column to include only records marked "Active", this widget can provide real-time visibility into how many items are still in progress.
2. Average Resolution Time for Support Tickets
Configure this widget to calculate the average time (in hours or days) it takes for a support ticket to move from "Created" to "Resolved". This is extremely useful for teams who need to monitor SLA performance and ensure timely issue resolution.
3. Monthly Revenue (Currency with Precision)
Use this widget to sum the "Invoice Amount" field for all completed transactions in the current month. Add a currency symbol (e.g., $) and precision formatting (e.g., 2 decimal places) to clearly represent financial metrics.
4. My Open Approvals
Show each user the number of approval tasks assigned to them that are still pending. Use a filter with the token [Current User Email]
and status = “Pending” to make the widget personalized and dynamic for each viewer.
5. Percentage of Completed Tasks
If your table has a Boolean column named “Is Completed”, use the Percent field type to show what percentage of tasks have been completed out of the total. Set the suffix to “%” for clear presentation.
6. Upcoming Events Count
Display the number of events scheduled within the next 7 days. Use filter conditions on a DateTime field to only include records where the date is between today and a future date token (e.g., Today + 7 Days
).
7. Flagged Items That Need Review
Use a Boolean or Single Select field marked “Flagged” to count how many items need manual review. This widget helps QA or compliance teams track how many issues are waiting for their attention.
8. Unique Contributors This Week
Apply the Unique Count function to a “Submitted By” or “User Email” field, filtered by the “Created Date” being within the last 7 days. This tells you how many different people submitted forms or triggered flows recently.
Configuration
Configuring the Metric Widget in Zenphi is a straightforward yet flexible process that allows you to turn raw table data into actionable, high-level insights. The widget is driven by your table structure and gives you the ability to define both the source of the data and how it should be interpreted through statistical or numerical functions. Here's a breakdown of how to set it up:
1. Data Source
The first step in configuring a Metric Widget is to select a Zenphi Table that contains the data you want to work with. This table acts as the underlying dataset from which the metric will be calculated.
- You can select any table from your Zenphi environment that you have access to.
- The widget will use the fields (columns) in this table to perform the required aggregations.
- If needed, you can later apply filters to this data source to narrow down which records the widget should consider (e.g., "only active users", "invoices from this month", etc.).
Tip: Choose a table that is actively updated through Flows, Forms, or integrations to take full advantage of Zenphi’s automation-driven insights.
2. Metric
Once your data source is selected, the next step is to define what metric to show — this consists of two elements:
a. Select Widget Data Field
This is the column from your table that you want the widget to analyze. You can choose from various field types including numeric fields (Integer, Decimal, Currency, Percent), text fields, and more.
b. Select a Function
Zenphi allows you to apply a statistical or aggregation function to your selected field. The available functions depend on the data type of the field:
For Numeric Fields (e.g., Integer, Decimal, Currency, Percent):
- Count: Counts the total number of records that have a value in this field.
- Sum: Adds all the values together.
- Average: Calculates the mean value.
- Minimum: Displays the smallest value.
- Maximum: Displays the largest value.
- Median: Shows the middle value when sorted.
- Unique Count: Counts how many unique values exist.
For Text/String Fields (e.g., Single Line, URL, etc.):
- Count: Total number of records that have a value in this field.
- Unique Count: How many distinct text values are present.
Example: If you select the “Invoice Amount” column and apply the Sum function, the widget will display the total amount of all invoices in the table (or filtered set). If you instead apply Average, it will show the mean invoice amount.
Widget Appearance
The Metric Widget in Zenphi Dashboards is highly customizable in its appearance, allowing you to visually tailor how the information is presented. Since widgets are modular and can be rearranged across a dashboard, their layout and styling play a vital role in making key metrics easy to read and engaging for end users.
Here’s a breakdown of all the appearance-related options you can configure:
1. Widget Border and Layout Integration
Each widget is rendered as a floating block within your dashboard. You can control its visual framing using the "Show Widget Border?" toggle:
- Enabled (border shown): The widget appears as a distinct, card-like section, visually separated from other widgets. Ideal for highlighting key metrics.
- Disabled (border hidden): The widget blends seamlessly into the dashboard with no border, giving a minimal and integrated look — great for tight layouts or compact summaries.
Tip: Hide the border if you’re building a sleek, inline KPI row; show the border when emphasizing a standalone statistic.
2. Widget Titles
You can set two distinct titles for the Metric Widget:
-
Main Widget Title (Top Title): This title appears above the metric number and helps describe the context of the widget (e.g., “Total Orders This Month”).
- Use the "Show Widget Title?" toggle to show or hide it.
- Ideal for dashboards where visual space is limited or where titles are communicated elsewhere.
-
Sub-Label (Below the Metric): This is a secondary label that appears right below the metric value. It’s perfect for clarifying units, time frames, or additional metadata (e.g., “As of Today”, “Year to Date”).
3. Style Configuration (Prefix, Suffix, Colors, Fonts)
You can customize the way the metric value is presented using prefixes, suffixes, and styling options:
a. Prefix and Suffix
Add text before (prefix) or after (suffix) the metric value to enhance context.
Example 1:
- Value:
19
- Prefix:
The amount is
- Suffix:
kilos
- Final Display:
The amount is 19 kilos
Example 2:
- Value:
1200
- Prefix:
$
- Suffix:
USD
- Final Display:
$1200 USD
These allow you to clearly indicate currency, units, or descriptive labels inline with the value itself.
b. Font Size and Color Customization
You can independently configure the font size and color for both the widget title and the metric value display (including prefix and suffix):
Title Font Settings:
-
Font Size Units: You can use any valid CSS unit for responsive design such as:
px
(pixels),em
(relative to current font size),rem
(relative to root),in
(inches),cm
(centimeters)
-
Font Color: Choose any color to match your brand or dashboard theme.
Metric Value Settings:
px
(pixels),em
(relative to current font size),rem
(relative to root),in
(inches),cm
(centimeters)- Set the color for the entire display — prefix, value, and suffix are treated as a unified line and styled together.
Filter Conditions
The Filter Conditions section of the Metric Widget allows you to precisely control which subset of your table data is used when calculating the metric shown in the widget. This is critical for creating personalized, dynamic, and context-aware dashboards — especially when different users or scenarios require different data slices.
How Filtering Works
When configuring your widget, you can define one or more filter conditions to limit the data used in the calculation. These filters are based on the fields (columns) in your selected table, and support both simple and complex logical expressions using AND
and OR
operators.
💡 Basic Components of a Filter Rule:
Each rule consists of:
-
Field Selection – Choose a field (column) from your selected data source table.
-
Condition Type – Choose how to compare the data, from the following list:
Equal to
Not equal to
Contains
Not contains
Starts with
Ends with
Has none of
(for multi-select types)Is null
Is not null
-
Value Comparison – You can:
-
Manually enter a fixed value (e.g.,
"Approved"
,50
,"John"
), or -
Use Token Picker to reference dynamic data from:
-
Current user context – such as:
- User ID
- User Email
- User Full Name
-
User attributes (e.g., “isAdmin” status)
-
-
AND vs OR Logic
- AND Conditions: All rules must be true for a record to be included in the metric.
- OR Conditions: At least one rule must be true for a record to be included.
You can combine multiple AND/OR blocks for complex logic. For example, filter all records created by the current user AND having a status of “Pending” OR “In Review.”
✅ Example Filter Scenarios
Here are some common and useful examples:
Example 1: Show Only Active Records
- Field:
Status
- Condition: Equal to
- Value:
Active
This will restrict the metric to only records where the status is "Active".
Example 2: Show Only Current User’s Records
- Field:
CreatedBy
- Condition: Equal to
- Value:
[Current User Email]
(from token picker)
This dynamically filters results so that each user sees only their own data.
Example 3: High-Value Orders (>$1000)
- Field:
Order Amount
- Condition: Greater than (via token-based comparison or manual)
- Value:
1000
This ensures only orders above $1000 are counted or averaged.
Example 4: Records Missing a Value
- Field:
Review Date
- Condition: Is null
This counts only records that haven't been reviewed yet (i.e., empty date).
Example 5: Admin-Only Data
- Field:
AccessLevel
- Condition: Equal to
- Value:
[User Attribute: isAdmin]
(True)
Restricts the widget to display metrics only if the viewer has admin access.
These filters make it possible to build role-based dashboards, user-personalized KPIs, and dynamic visual reports — all without needing to build separate dashboards or widgets for every case.
👤 Example Scenario: Show Each Employee Their Own Task Count
Let’s walk through a practical scenario to better understand how filtering and token-based personalization work with a Metric Widget.
Goal
We want to show each employee the number of tasks assigned to them, so when they log in and view the dashboard, the widget displays only their own data, not the full table.
Widget Setup
➤ Data Source
A Zenphi Table named EmployeeTasks
with columns such as:
Task Name
(Single line text)Assigned To Email
(Email of the employee)Status
(Single select: "Pending", "Completed", etc.)
➤ Metric Configuration
-
Data Field:
Assigned To Email
-
Function:
Count
We’re counting how many records (tasks) exist for each user.
Filter Conditions
Apply the following condition in the widget settings:
Assigned To Email → Equal To → {{Current User Email}}
✅ This ensures that when an employee views the dashboard, the widget only counts records where their email matches the Assigned To Email
column.
You can also add an optional condition to count only pending tasks:
AND
Status → Equal To → Pending
🎨 Appearance Settings
- Title:
My Open Tasks
- Prefix:
You have
- Suffix:
tasks
- Show Widget Border: Disabled (to blend it into the dashboard)
- Font Size: Responsive (
1.5rem
) - Color: Custom (e.g., green for motivation)
So if an employee named Sarah with email [email protected]
has 5 pending tasks, the widget will read:
You have 5 tasks
Result & Value
Now, the same dashboard shows personalized task counts to each employee using secure token-based filtering.Managers, team leads, or IT admins don’t need to build separate dashboards per user — this one widget dynamically adapts based on who's viewing it.
This is a simple but powerful use case showing how Zenphi’s deep integration between tables, tokens, and dashboard widgets makes it easy to create smart, context-aware automations and insights — no coding required.
Updated 1 day ago