> 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/how-to-customize-the-right-click-menu.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Add actions to events

Add an Edit action to each event and a New visit action to empty spots of the Avonni Calendar, so dispatchers act on the schedule without leaving it.

A dispatcher needs to fix a visit's details or book one into a gap, without leaving the calendar. Context menu actions add an **Edit** item to each event and a **New visit here** item to empty spots. Each item runs an interaction, such as opening a flow.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F42eAbTvg0rTTCyqWs066%2Fcalendar-how-to-customize-the-right-click-menu-result.png?alt=media" alt="A right-click on the Boiler inspection visit opens a menu with an Edit item and a pencil icon"><figcaption><p>A right-click on a visit shows the Edit action.</p></figcaption></figure>

## Before you start

* A screen flow with the Avonni Calendar showing Events from a **Query** data source. See [Use a Query data source](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/using-a-query-data-source.md).
* A screen flow that edits an Event. It takes a Text input variable `recordId` and ends with an Update Records element.

## Steps

{% stepper %}
{% step %}

### Add the event actions

1. In the **Properties** tab, open **Context Menu Actions**.
2. Under **Event**, add an action with **Label** `Edit`, **Name** `edit` and **Icon Name** `utility:edit`.
3. Under **Empty Spot**, add an action with **Label** `New visit here`, **Name** `new-visit-here` and **Icon Name** `utility:add`.

**Event** actions appear when the user right-clicks an event. **Empty Spot** actions appear on a right-click on an empty slot.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FNW9qpOwgpkKrg0vUJIQz%2Fcalendar-how-to-customize-the-right-click-menu-actions.png?alt=media" alt="The Context Menu Actions section with Edit under Event and New visit here under Empty Spot, each list with its Add button" width="320"><figcaption><p>Event and Empty Spot actions in Context Menu Actions.</p></figcaption></figure>
{% endstep %}

{% step %}

### Open the edit flow from the Edit action

1. In the **Interactions** tab, under **Event Action Click**, add an interaction. In **Target Name**, pick **Edit**: the list shows each action by its label.
2. Set **Type** to **Open Flow Panel** (or **Open Flow Dialog**) and pick your edit flow in **API Name**.
3. In **Input Variables**, add `recordId`, set **Type** to **Text** and set its value to **Record > Id**.
4. In **On Finish**, add **Refresh Query** so the calendar shows the change.
5. Set the panel **Size** to **medium** or larger: at **small**, dates and times are cut off.

{% hint style="info" %}
The side panel is only as tall as the calendar. If the panel shows only the first field, give the calendar a height in the **Style** tab, under **Size**, for example `600px`.
{% endhint %}
{% endstep %}

{% step %}

### Create an event from an empty spot

1. Under **Empty Spot Action Click**, add an interaction and pick **New visit here** in **Target Name**.
2. Set **Type** to **Navigate**, **Page Reference Type** to **Object Page**, **Object Api Name** to `Event` and **Action Name** to `new`.
3. In **Prefilled Values**, map `StartDateTime` to **Start Date Time** and `EndDateTime` to **End Date Time**.

The two values hold the slot the user right-clicked.
{% endstep %}

{% step %}

### Save and test

Save the screen flow and run it. Right-click a visit and choose **Edit**: the edit flow opens in a side panel, and after you save, the calendar shows the new details. Right-click an empty slot and choose **New visit here**: the New Event page opens with the slot's start and end.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FfQ0hNOERSn7fyftnSczK%2Fcalendar-how-to-customize-the-right-click-menu-panel.png?alt=media" alt="The running calendar with the Edit visit side panel open on the right, showing Subject Boiler inspection, Start and End on Nov 17, 2026 and a Save button"><figcaption><p>Edit opens the edit flow in a side panel.</p></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
For deleting or duplicating, **Event Action Click** also offers **Delete Selected Record(s)** and **Duplicate Selected Record(s)**, with no flow to build.
{% endhint %}

## Troubleshooting

<details>

<summary>The menu item shows but nothing happens</summary>

The interaction has no **Target Name**, or points to another action. Pick the action again in **Target Name**: the list shows each action by its label. An **Event** action is wired under **Event Action Click**, an **Empty Spot** action under **Empty Spot Action Click**.

</details>

<details>

<summary>The edit flow opens but the record is empty</summary>

Check that the input variable name matches the flow variable (`recordId`), that the flow variable is available for input, and that its value is **Record > Id**.

</details>

## Related tutorials

* [Add a New Event button to the header](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/how-to-add-a-new-event-button-to-the-avonni-calendar-header.md): one action for the whole calendar.
* [Create an event by dragging and save it](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/how-to-create-events-by-dragging-in-the-avonni-calendar.md): book a visit by drawing its slot.
* [Reschedule events with drag and drop](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/how-to-reschedule-events-with-drag-and-drop.md): change a visit's time without a form.


---

# 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/how-to-customize-the-right-click-menu.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.
