Create an event by dragging and save it
Let a dispatcher draw a time range on the Avonni Calendar and save it as a new Event, with the start and end already filled in from the drag.
A dispatcher sees a free slot on Thursday afternoon and wants to book a boiler inspection there. With New Event Drag, they draw the slot on the calendar, a form opens with the start and end already filled in, and the visit is saved as an Event.

Before you start
A screen flow with the Avonni Calendar on a Screen element, showing Events. See Calendar 101.
A second screen flow that creates the Event. It takes two Date/Time input variables, for example
startDateTimeandendDateTime, and uses a Create Records element.A Query data source if you want the new event to appear without reloading the page. See Use a Query data source.
Steps
Add the New Event Drag interaction
Open the Calendar in the Component Builder and go to the Interactions tab.
Under New Event Drag, add an interaction.
Set Type to Open Flow Dialog and pick your create flow in API Name. The list shows each flow by its label.
Until this interaction exists, users cannot draw new events on the calendar.

Pass the drawn range to the flow
In Input Variables, add two rows:
startDateTime
Date/Time
Start Date Time
endDateTime
Date/Time
End Date Time
Start Date Time and End Date Time are the start and end of the range the user drew. In the create flow, use the two variables for StartDateTime and EndDateTime on the new Event.
Decide whether past slots are allowed
By default, users can draw events in the past. To stop that, turn on Prevent Past Event Creation at the top of the Interactions tab. See Block past dates and limit working hours.
Save and test
Save the screen flow and run it (the drag does nothing in the Component Builder preview). Drag across two hours on Thursday afternoon. The dialog opens with the start and end of that range, and after you save, the new Event appears on the calendar.

To open the standard New Event page instead of a flow, set Type to Navigate, Page Reference Type to Object Page, Object Api Name to Event, Action Name to new, and map StartDateTime and EndDateTime in Prefilled Values to Start Date Time and End Date Time.
Troubleshooting
Related tutorials
Reschedule events with drag and drop: move an existing visit and save the new time.
Add a New Event button to the header: create events without dragging.
Add actions to events: create an event from a right-click on an empty spot.
Last updated
Was this helpful?
