> 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-add-a-new-event-button-to-the-avonni-calendar-header.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Add a New Event button to the header

Add a New visit button to the Avonni Calendar toolbar that opens the New Event page, so dispatchers can book a visit without dragging on the schedule.

Not every booking starts from a free slot. When a customer calls with a request, the dispatcher wants one button that opens a blank Event form. A header action and the **Toolbar Action Click** interaction put a **New visit** button in the calendar toolbar.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FzzXIw9MBiGcGPiNpCG1U%2Fcalendar-how-to-add-a-new-event-button-to-the-avonni-calendar-header-result.png?alt=media" alt="Avonni Calendar titled Field service team with a New visit button and a plus icon in the toolbar, next to the navigation arrows, Today and the date picker"><figcaption><p>The New visit button sits in the calendar toolbar.</p></figcaption></figure>

## Before you start

* A screen flow with the Avonni Calendar showing Events. See [Calendar 101](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/calendar-101-tutorial.md).

## Steps

{% stepper %}
{% step %}

### Add the button to the header

1. In the Component Builder, open the **Properties** tab and go to the **Header** section.
2. Under **Actions**, click **Add Actions**.
3. Set **Label** to `New visit`, **Name** to `new-visit` and **Icon Name** to `utility:add`.

**Name** identifies the action. Keep it lowercase, without spaces, and unique among the header actions.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FOvFk8u6FvkeVxlHnEyWV%2Fcalendar-how-to-add-a-new-event-button-to-the-avonni-calendar-header-actions.png?alt=media" alt="The Header section of the Component Builder with the New visit action under Actions, the Add Actions button and Visible Actions Buttons set to 1" width="320"><figcaption><p>The New visit action in the Header section.</p></figcaption></figure>
{% endstep %}

{% step %}

### Keep the button visible

**Visible Actions Buttons** sets how many header actions show as buttons. The others move into a menu. With one action, the default is fine. With several, raise the number so **New visit** stays a button.
{% endstep %}

{% step %}

### Wire the button

1. Go to the **Interactions** tab.
2. Under **Toolbar Action Click**, click **Add Toolbar Action Click**. In **Target Name**, pick **New visit**: the list shows each action by its label.
3. Set **Type** to **Navigate**, **Page Reference Type** to **Object Page**, **Object Api Name** to `Event` and **Action Name** to `new`.

To use a flow instead of the standard form, set **Type** to **Open Flow Dialog** and pick your create flow.
{% endstep %}

{% step %}

### Save and test

Save the screen flow and run it. The toolbar shows **New visit** with a plus icon. A click opens the New Event page.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>The button shows but nothing happens on click</summary>

The interaction has no **Target Name**, or points to another action. Open it in the **Interactions** tab and pick **New visit** again in **Target Name**.

</details>

<details>

<summary>The button is inside a menu instead of the toolbar</summary>

Raise **Visible Actions Buttons** in the **Header** section.

</details>

## Related tutorials

* [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 straight into a slot.
* [Add actions to events](https://docs.avonnicomponents.com/flow/tutorials/components/calendar/how-to-customize-the-right-click-menu.md): add actions to each event and to empty spots.


---

# 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-add-a-new-event-button-to-the-avonni-calendar-header.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.
