---
title: "Canvas setup · Timeline docs · Ninth Forge"
url: https://ninthforge.com/docs/timeline/canvas
description: "Add the Timeline to a canvas app and save moves and resizes with Patch."
---

# Canvas setup

In a canvas app, the Timeline shows your items and raises events when users move, resize or open them; your formulas do the saving. Set **Save mode** to `"event"` and `Patch` in **OnItemChange**.

The examples use a table **Initiatives** with Name, Start and End (date only), Theme, Status, Horizon, Depends on (a lookup to Initiatives) and Is milestone. Its ID column is **Initiative**. Replace the names with yours.

## 1\. Allow code components

Once per environment, an admin turns on **Allow publishing of canvas apps with code components** (Power Platform admin center → your environment → Settings → Product → Features).

## 2\. Add the Timeline

1.  In Power Apps Studio, add **Initiatives** under **Data**.
2.  **Insert → Get more components → Code**, tick **Ninth Forge Timeline**, **Import**.
3.  **Insert → Code components → Ninth Forge Timeline**, and size it to the screen.

## 3\. Bind it

| Property | Value |
| --- | --- |
| Items | `Initiatives`, or a `Filter` of it |
| Fields | Start date → Start, End date → End, Lane → Theme, plus any of Status, Horizon, Depends on, Is milestone and Colour |
| Fiscal year starts | `7` for a July year, or your month |
| Save mode | `"event"` |
| Licence key | Your Plan key as text, for example from an app variable. If the roadmap still says “Unlicensed”, see [Help](https://ninthforge.com/docs/help#ninth-forge--unlicensed-shows). |

Canvas apps can’t read choice colours from Dataverse, so status and lane colours come from the built-in meanings and palette. Lanes are in alphabetical order.

## 4\. Save edits: OnItemChange

Every move, resize and undo sets `Self.lastChange` to JSON, then raises **OnItemChange**.

-   The JSON has the item `id` and only what changed: `start` and `end`, as `YYYY-MM-DD` dates.
-   A milestone without an end date is moved with `start` only.
-   The Timeline keeps the edit on screen while it waits up to 10 seconds for the record to change. If the record doesn’t change, it puts the item back and shows “Not saved”.

```
With(
    { c: ParseJSON(Self.lastChange) },
    With(
        { r: LookUp(Initiatives, Initiative = GUID(Text(c.id))) },
        Patch(Initiatives, r, {
            Start: Coalesce(DateValue(Text(c.start)), r.Start),
            End: Coalesce(DateValue(Text(c.end)), r.End)
        })
    )
)
```

## 5\. Open items: OnOpenItem

Double-click or Enter on an item sets `Self.selectedItemId` and raises **OnOpenItem**:

```
Set(varItem, LookUp(Initiatives, Initiative = GUID(Self.selectedItemId))); Navigate(EditScreen)
```

`Self.selectedItemId` also follows the selection, so a details panel beside the Timeline can show the selected item.

## Licensing note

Dataverse is a premium connector, so a canvas app on Dataverse needs premium Power Apps licences anyway. The Timeline makes no network calls and adds no licensing requirement.

Last updated 9 November 2026
