> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Latest Snapshots

> View the results from the most recent evaluation in an evaluation group

## What are Latest Snapshots?

A *latest snapshot* is a widget on an evaluation group dashboard that computes against only the most recently created evaluation in a group.

<Info>
  "Most recent" is defined as the evaluation in the group with the latest `created_at` timestamp -- **not** the order in which evaluations were added to the group.
</Info>

## When to use it

* **Snapshot tiles** at the top of a dashboard that need to read the last run's score.
* **Comparison views** where you want the latest run highlighted alongside trend visualizations of the full group.
* **Always-fresh KPI widgets** that should automatically refocus on a new evaluation as soon as it's added to the group.

## Where it applies

Latest snapshots are only available on widgets that issue a query.

| Widget type             | Latest Only available?                                          |
| ----------------------- | --------------------------------------------------------------- |
| Metric (Query Value)    | Yes                                                             |
| Bar                     | Yes                                                             |
| Histogram               | Yes                                                             |
| Donut                   | Yes                                                             |
| Table (grouped or flat) | Yes                                                             |
| Scatter                 | Yes                                                             |
| Timeseries              | Yes, but rarely useful -- collapses the chart to a single point |
| Markdown, Heading       | Not applicable                                                  |

The toggle is **only available on evaluation group dashboards**.

## Enable via the UI

Toggle **Latest only** in the widget modal when creating or editing a widget.

<Frame>
  <img src="https://mintcdn.com/scalegp/yA89mjKr_uD_bm8s/images/v5/evaluation-dashboards/widget-modal-latest-only-toggle.png?fit=max&auto=format&n=yA89mjKr_uD_bm8s&q=85&s=aed8b272fcf0ec4edc51cb57aece1ae4" alt="Latest only toggle in the Add Widget modal" width="1024" height="505" data-path="images/v5/evaluation-dashboards/widget-modal-latest-only-toggle.png" />
</Frame>

## Enable via the SDK

Set `latest_only: true` on the query payload when creating or updating the widget. The flag is supported on both `SeriesQuery` (Bar / Histogram / Donut / Table / Scatter / Timeseries) and `MetricQuery` (Metric / Query Value).

```python theme={null}
# Metric widget that always shows the average score of the most recent run in the group
client.evaluation_dashboards.widgets.create(
    dashboard_id=dashboard.id,
    title="Latest Snapshot: Average Score",
    type="metric",
    query={
        "select": [
            {
                "expression": {
                    "type": "AGGREGATION",
                    "function": "AVG",
                    "column": "overall_score",
                    "source": "data",
                },
            }
        ],
        "latest_only": True,
    },
)
```

Omitting `latest_only` or setting it to `false` keeps the existing behavior of computing across the full group.
