A calendar of Salesforce events with a New Event button that opens a flow and refreshes the calendar.

Build an event calendar in a screen flow, with a button that opens a second flow to create an event and a calendar that refreshes after. For Salesforce admins who manage events in flows.
Hi everyone, and welcome to this tutorial on the Avonni Calendar component for Salesforce Flows. In this tutorial I will focus on two key interactions. The first one is opening a flow dialog, so I will create a button that, when clicked, will pop up a modal box that will open another flow. And now let me show you
what I'm going to build today in this video. So here, this is an example of the Avonni Calendar I set up using a query data source to fetch all the events from the Event object. And what I'd like to do here on this Calendar is to put a button action right there to create a new event, and this new event button action will trigger a flow dialog, and I will create another flow to be able to create a new event directly on the Calendar. And I will show you how to set up also the Refresh query interaction, to make sure that the Calendar will automatically refresh with the new updated data. So let's dive into
this. Okay, we need to create another flow to be able to capture information to create a new event, and this new data entry will be linked to the Avonni Calendar on the other flow. So that's the new flow I'm going to create. I just added a screen element, and let's build this screen flow together. So let's edit the component. I will just add the Footer to go to the next screen, and I will use some of the Avonni components to create my screen flow. So let's add, let's say, "Create a meeting". So I'm configuring the Header of this flow. Let's say avatar right there, let's pick up an icon. Okay, let's pull to boundary left and right, the same top, and let's apply some styling right there on the Header component: margin bottom, large, to add some extra space. Let's get back to the properties panel, is joined, and that's it. Okay, so I just created the Header component. Now let's drag a section element, because on this new screen flow I'd like to capture information about subject and related to. I'd like to create a new event that would be related, let's say, to an opportunity. So for the subject I will use the text element, Subject, that's pretty basic. Let's use the Avonni Combobox right there for the related to. So Related To, Combobox, open the Component Builder, let's name it Related To. Okay. Let's do a query on the data source. We'd like to display the opportunity name right there. Opportunity, okay, that's already fetching information. For the icon name, let's add the opportunity icon. What I like the most about the Component Builder is you can get a preview of the component you're building, which is really great, because you can see, oh, maybe I'd like to change the size of the icon, or change the variant of the icon. Okay, perfect, done. So I added the Header, Subject, which is a text field, and the Combobox. Next, to create a new event, I need to select date time, and for that I like to use the Avonni Date Time Picker, which is really great, by the way. Date Time Picker, open the Component Builder, and let's configure the Date Time Picker. So I like to use the weekly variant. As you can see, the look and feel is like the source SCH, it's exactly the same look and feel. Input, yes. Inline, no, no, I prefer input. I want to really focus on being able to select the time. Visible state, date time. Let's say, okay, from maybe 9 to 5, so 17. Okay, so we can adjust the settings of the component if we need to. Perfect, and that's pretty much done. I just created the screen flow to create a new event right there: Header, Subject, Combobox and Date Time Picker. Next, let's create a formula text, a formula resource. Why? Because if I'm taking the Date Time Picker right there, basically I'm capturing the information about the start time, I'm not capturing the information about the end time. I know that we are using a 30 minute slot on the meeting, so I need to capture that, and for that I will create a formula, a variable formula, right there. New resource, formula, let's say End Time, date time formula, and for the resource I will select the Date Time Picker value. And then what I would do, I would just add a formula that says add 30 minutes, so it's add 30 divided by the number of hours in minute. Check syntax, perfect. Okay, so now we will be able to use this formula to fetch the end date time information when I'm creating a new event. So here, let's say
Create Records, Create New Event. Okay, on the object, it's Event. Let's say for the subject, let's use the value of the Subject element. Now for the start date time, let's use the information from the Date Time Picker value. Now for the end date time, let's select the formula. Okay, and finally we added a Combobox of all the opportunities information, so we just do related to, the WhatId, is equal to the value of the Related To Combobox value. That's perfect, that's pretty much done. As you can see, it's a basic flow. Now I can save that flow right there, and let's activate the flow. Now we can get back to the
Calendar component, the original flow I have right there. So let's select the Avonni Calendar component, open the Component Builder, and what I need to do right now, I need first to add a button action. So here on the Header I will say Add action, New Event. Okay, the button is created, but right now it's not functional. To make the button action functional, I need to
go on Interactions, and I need to define what will happen when users are pressing this New Event button. So for example here on the toolbar, because we are on the toolbar, Add toolbar, target name New Event, and what I'd like to do is I'd like to open a flow, Open Flow Dialog, and I'd like to open the flow Demo Avonni Video New Event. That's the flow we just created before, to have like a modal box to be able to create a new event. For this use case I don't need to pass any input variables, that's pretty much general. And then that's where it's very useful and powerful: I will define the on finish interaction. So let's say on finish, I'd like to refresh the Calendar with the new updated information, and I'd also like to notify the user by showing a toast. Let's say "Event created, thank you", variant success. Okay, so now I can click Done and activate this flow to do a live test. Okay, let's refresh the
page. Now I can see the New Event button. Let's press this event button. It's launching the flow, which is fine. As you can see, it's clunky, it's not the best. So what I would do before testing the flow, I would just go back on the Avonni Calendar demo, and what you can do for that: open the Component Builder, and on Interactions, toolbar, you will set a size, and you will select medium. That's all, it's just for the look and feel. So let's refresh. New Event: it's bigger, it's better. So let's say "demo", I'd like to relate it to this opportunity, and let's book for today, Tuesday, at 4 p.m. Next. Event is created, the information is updated live here, and I can see the new event created right there. So that's pretty much what I'd like to show you in this video today. It's about the Avonni Calendar, how you can set up the interaction on the Avonni Calendar to open another flow, and on that other flow how you can really capture data easily by using the Avonni components or other standard components to capture the data live on Salesforce, and also make sure that the Calendar is refreshing automatically based on the new data you added. So let us know in the comment section below if you have any comments on this video. Thank you so much.
Add an action on the Calendar Header, then in Interactions add a toolbar interaction with that target name and the Open Flow Dialog type, and select the flow to open.
In the Open Flow Dialog interaction, add an on finish interaction that refreshes the Calendar query, and optionally a show toast with the success variant.
Create a Date/Time formula resource that adds 30 minutes to the Date Time Picker value, then use it as the end date time in the Create Records element.
Browse the whole library, filtered by where it runs and what you want to build.
All video tutorials