> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/calendar-101-tutorial.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Calendar 101

Build a team calendar in a screen flow from a Get Records collection, with one row per technician and their visits for the week.

A dispatcher at a field service company plans the week for three technicians. Two Get Records elements load the technicians and their visits, and the Avonni Calendar shows them on a timeline with one row per technician.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FyNACcEli0Knl3Si4cLdG%2Fcalendar-calendar-101-tutorial-result.png?alt=media" alt="Avonni Calendar timeline titled Field service team for the week of November 15, 2026, with one row each for Michel Chartrand, Celia Desjardins and Hubert Michaud-Dufour and their visits colored per technician"><figcaption><p>One row per technician, each visit on the row of the user it is assigned to.</p></figcaption></figure>

## Before you start

* The Avonni Flow Screen Components package is installed and you have the **Avonni Flow Screen Components** permission set.
* Your technicians are Salesforce users, and their visits are standard `Event` records assigned to them.
* You know how to add a Get Records element to a screen flow.

## Steps

{% stepper %}
{% step %}

### Get the technicians and their visits

The calendar needs two record collections before the screen: the people (resources) and what they do (events).

1. Add a **Get Records** element on **User**. Filter it to your technicians, for example on `Department` or `ProfileId`, and store **All records**.
2. Add a second **Get Records** element on **Event**. Filter it on `StartDateTime` so it returns the visits you want to plan, and store **All records**.

Both elements must run before the screen that holds the calendar.
{% endstep %}

{% step %}

### Add the calendar to a screen

1. Add a **Screen** element after the two Get Records elements.
2. From the Components panel, drag the **Avonni Calendar** onto the screen and give it an API name, for example `teamCalendar`.
3. Open the Component Builder. The settings are in the **Properties** tab.
   {% endstep %}

{% step %}

### Choose the Variable data source

**Variable** tells the calendar to read records your flow already holds.

1. In the **Data Source** section, select **Variable**.
2. In **Resources Collection**, pick the User collection from the first Get Records.
3. In **Events Collection**, pick the Event collection from the second Get Records.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fcvt59ExUIhgKBZhb3zO1%2Fcalendar-calendar-101-tutorial-panel.png?alt=media" alt="Calendar Properties tab with Data Source set to Variable, Resources Collection Get Technicians, Events Collection Get Visits, and the Data Mappings for resources and events" width="320"><figcaption><p>Variable reads the two Get Records collections; Data Mappings says which field holds what.</p></figcaption></figure>

To read Event records directly, without Get Records, use a Query data source instead: see [Use a Query data source](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/using-a-query-data-source.md).
{% endstep %}

{% step %}

### Map the technicians and their visits

In the **Data Mappings** section, tell the calendar which field holds what.

| Mapping                    | Field           | What it does                           |
| -------------------------- | --------------- | -------------------------------------- |
| Resources > **Label**      | Full Name       | The name shown on each row             |
| Events > **Key Field**     | Id              | The unique value of each event         |
| Events > **Title**         | Subject         | The text on each event                 |
| Events > **Resource Name** | Assigned To ID  | Puts the event on its technician's row |
| Events > **From**          | Start Date Time | Where the event starts                 |
| Events > **To**            | End Date Time   | Where the event ends                   |

{% hint style="info" %}
**Resource Name** must hold the same value as the resource **Key Field**. The resource **Key Field** sits under **Advanced Options** and already uses the record Id, so here both are User IDs and you leave it as is. An event whose value matches no technician does not appear.
{% endhint %}
{% endstep %}

{% step %}

### Pick the view the dispatcher opens on

1. Set **Selected Display** to **Timeline**: one row per technician, time across.
2. Set **Selected Time Span** to **Week**.
3. Leave **Start Date** empty to open on today, or map it to a date variable to open on a planned week.

The other settings (header, available times, context menu, styling) are listed on the [Calendar reference](https://docs.avonnicomponents.com/flow/flow-components/calendar.md) reference page.
{% endstep %}

{% step %}

### Save and test

Save the flow and run it with **Debug**. The calendar opens on the current week, on a timeline with one row per technician, labelled with their full name. Each visit sits on the row of the user it is assigned to, from its start time to its end time, with its subject as the title.

If a row reads **Empty** or a visit is missing, see [Troubleshoot resources and missing events](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/troubleshoot-resources-and-missing-events.md).
{% endstep %}
{% endstepper %}

## Related tutorials

* [Use a Query data source](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/using-a-query-data-source.md): read Event records live, without Get Records.
* [Customize the time spans](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/how-to-customize-time-spans.md): offer a three-day or two-week view.
* [Block past dates and limit working hours](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/block-past-dates-and-limit-working-hours.md): show only 08:00 to 18:00, Monday to Friday.
* [Color-code calendar entries](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/how-to-color-code-calendar-entries-in-the-avonni-calendar.md): tell inspections from calls at a glance.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/calendar/calendar-101-tutorial.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
