Video tutorials
/
How to make the Avonni Calendar Reactive and communicate with other Screen Flow Components
Screen Flows

How to make the Avonni Calendar Reactive and communicate with other Screen Flow Components

Select a row in a Data Table and the Avonni Calendar on the same screen shows only its events.

Intermediate
8:19
Tutorial
How to make the Avonni Calendar Reactive and communicate with other Screen Flow Components
Play video
Chapters
0:00 Introduction 1:17 Avonni Data Table configuration 2:33 Reactive formula creation 3:22 Avonni Calendar setup 6:40 Flow finalization & App Builder integration 6:59 Live Salesforce demo
Click a chapter to jump to it
Watch on YouTube

What you will build

Connect the Avonni Calendar to an Avonni Data Table on the same screen, so the calendar follows the selected row. For Salesforce admins who build reactive screen flows.

  • An Avonni Data Table with selectable rows
  • A formula that filters events on the selected row (WhatId)
  • The Avonni Calendar, set to use that formula in its query
  • The flow added to a page with Lightning App Builder, and a live demo

Transcript

0:00 Introduction

Hello everyone and welcome. My name is Cédric, and I'm excited to be your host for this new video about the Avonni Components. Today I'm going to show you how to set up the Avonni Calendar with the query data source, to make sure that the Calendar can be reactive with other Avonni components. So let's dive into the example right now. So the example we are going to build today is this one. We have a screen flow featuring two Avonni components. On the left we have the Avonni Data Table, displaying just a list of opportunities, and on the right, right there, we have the Avonni Calendar that is displaying a list of events. But the thing is, the Avonni Calendar is communicating with the selection I made on the Data Table. For example, if I'm changing the opportunity selected, it will automatically refresh the Calendar with the events based on the selection I made on the Data Table. How am I able to do that? Because I configured the Avonni Calendar using the query data source, to make sure that the Calendar is working with reactive screens. Let me show you how to set that up from scratch. So this is our screen flow. Let's open the Screen element, and

1:17 Avonni Data Table configuration

right there, let's select the Avonni Data Table on the left to open the Component Builder. I already set up the Avonni Data Table to display a list of opportunities, so it's a basic setup. What I did, regarding the data source, I used a query data source to fetch all the opportunities, and then I just dragged the columns, all the fields, on my Data Table, to configure the look and feel of this. The thing is, you need to make sure that the Max Row Selection setting is set to one. So with that you will have radio buttons right there, to be able to select only one opportunity on the Data Table. If you don't set it to one, you will have checkboxes, which is not what we want in our use case, because we want users to be only able to select one opportunity at a time. So make sure to set the Max Row Selection to one on the Data Table. So before dragging the Avonni Calendar right there on the right panel, we need to create a new resource, a new formula variable resource, to make sure that the Calendar will be reactive and will display events based on the selection made on the Data Table. So we create a new

2:33 Reactive formula creation

resource, Formula. Let's name it opportunity filter, data type Text. That's the syntax I'd like to use for my formula, and between the end signs we will go Insert Resource, select the Data Table screen component we added first, selected, and now select the opportunity ID. So basically this formula will dynamically push the WhatId based on the first selected row ID on the Data Table. We can check syntax. Done. Now we can go back on our Screen element, and this time we are going to drag the Avonni

3:22 Avonni Calendar setup

Calendar. Let's name it calendar. Open Component Builder, and what we need to do first is use the data source section and configure the query mode. So let's query the Event object, and now for filters, I need to filter dynamically the events based on the selection I made on the Data Table. And for that I will select Map, and map that to the formula I just created before, the reactive formula. And now I can configure the data mapping. So for the title I will select Subject. With source name, it's the Assigned To ID. Label, calendar name. Let's select start date time and end date time. And you can adjust other settings in the Calendar. For example, I will adjust the selected time span: I want to display the week. For Header, I'd like to say caption, related events. Let's select an icon right there. Perfect. And we can also fine-tune the look and feel of the Calendar. If we don't want to display the resource filter, we can hide that as well. And if we want, we can also add button actions at the top. So let's say add a new action, New Event. So this is creating the button New Event. Now, because the button is created, I can go on Interactions and select On Toolbar, add Toolbar. Let's select New Event, and what I'd like to do is I'd like to open another flow. I already created a flow to create a new event, so it would be the New Event flow. And I don't need to pass any input variable for this example. But, and this is exactly why the query data source on the Calendar is so powerful, because you now have the ability to define interactions when this flow is finished. So for example, add item, and what I would do, I would say, oh, Show Toast, toast message: Thank you, and then event created, success. Close. And let's add another item, and this one, that's maybe one of the most powerful features of the Avonni components, is the Refresh Query interaction. So basically, when I select Refresh Query, this will automatically refresh only the Calendar when this new flow is finished, to integrate the new data I just added with the flow. Save. And now we can click on Done, Done again, and save the

6:40 Flow finalization & App Builder integration

flow. Now we can go on App Builder and drag the Flow component on any page, and select the flow we'd like to display. So that's the demo calendar query flow. Save. Go back. Now I have my list of

6:59 Live Salesforce demo

opportunities. If I'm selecting an opportunity here, I can see related events. It's working perfectly fine. Perfect. Let's... today, let's select this opportunity. Let's add a new event: demo of video. Select an option. Let's assign it to this opportunity. Let's make it today, from 4:00 PM to 5:00. Save. I have the notification message, and now the event is displaying right there on the Calendar, live, thanks to the Refresh Query interaction on finish. So that's really a basic video about how to use the Avonni Calendar query data source, how to configure the data source on the Avonni Calendar to make sure that the Avonni Calendar is reactive and can communicate with other components you have in your screen flow. If you have any question or comment, let me know in the video section just below. Thank you so much.

Show the full transcript

Questions this video answers

How do I make the Avonni Calendar react to a selection in a data table in the same screen flow?

Create a Text formula that returns the ID of the Data Table's first selected row, then set the Calendar data source to query mode and map its filter to that formula. The Calendar refreshes when the selection changes.

How do I limit the Avonni Data Table to one selected row?

In the Component Builder, set Max Row Selection to 1. The table then shows radio buttons instead of checkboxes.

How do I show a new event on the Avonni Calendar right after creating it in another flow?

Use the query data source on the Calendar, add a Toolbar interaction that opens your New Event flow, and add a Refresh Query interaction on finish so the Calendar reloads its data.

See it as a use case
No items found.
Build it in your org

Free in sandboxes, 10 free production licenses.

Start free
Keep going

Related tutorials

Find your next tutorial

Browse the whole library, filtered by where it runs and what you want to build.

All video tutorials