On an Experience Cloud site, link a data table to a map so the map follows the user's selection.

Build a reactive map on an Experience Cloud site: a data table and a map that filter together. For Salesforce admins who build portals and want location data without code.
Hello everyone, and welcome. Today's video is all about the Avonni components in Experience Cloud sites, and today I'm really excited to show you the power of the Avonni components regarding reactive components for Experience Cloud sites. So you might be wondering what makes reactive components so special. Well, imagine this: you're building a website or an app, and you want different parts to seamlessly talk to each other, and that's where the reactive components shine. Those components are like little messengers that keep everything updated in real time, making your website feel super smooth and interactive. So to show you how this all works, we are going to dive into a practical example. We will create a list of accounts using the Avonni Data Table, and right next to it we will have the Avonni Map. And the cool part about that is when you select an account from the Data Table, the Map will automatically zoom to the location of that account. So it's really great to visualize data and make sure that everything comes alive. So let's build the example together. I am on
my Experience Cloud site, I am on the account list page, and the first thing I need to do to have like two components next to each other is to drag first a layout component. So I will use the Avonni Layout right there to create a more custom layout. So I'm using the Avonni Layout to create a more custom layout. For that I will set up the columns from there, from the Avonni custom property editor. For the first one, fixed, let's say 8 of 12 for the size. I will add some padding, horizontal medium. The same for the second one on the right, let's set a size of 4, and for the padding, horizontal medium. So now the layout is set up, I have my two columns, and I'm able to drag the first component, which is the Avonni Data Table, on the left. So I'm dragging the Avonni Data Table right there, and from
there I'm able to customize and build my Data Table using once again the properties panel. The first thing I need to set up, because I want to have the Avonni Data Table reactive with the Map, I need to specify an API name. I need to enter an API name, so let's say "datatable", that's my API name. Now let's configure the Data Table. I need to scroll down to the data source section to create and to connect my Salesforce data with the Data Table. So here I'm using a query, and I'd like to select the Account object. Now next I need to create my columns, so we'll select Name, I'm selecting then the Industry, let's select now next the Billing City. As you can see, the Data Table is updating live, so you can get a real nice preview of how the Data Table looks. Let's fine-tune the settings on the Data Table, and because I only want to be able to select one account at a time, I need to set right there at the top Max Row Selection. Instead of having checkboxes, I'd like to have radio buttons, so I will just set the max row selection to one, to be only able to select one account at a time. That's for the left side, regarding the Data Table.
Now let's do the right side. I'd like to display the Map, but before displaying the Map I'd like to add the Avonni Card, that would be like a container. So I'd like to display the Map inside the Card. So we just drag the Avonni Card from there and customize the Card. Let's say "Location", for example, Location. Select an icon name. Content, pull pack padding. So now I have a slot, like content, to drag the Avonni Map. By the way, I'm using an LWR site. If you're trying to reproduce the exact same tutorial on another site, you won't have the ability to drag and to use the layout properly and to use slots. That's a limitation from AA side. Okay, now let's drag the Avonni Map. Dragging the Map, and like the Data Table, I'm able to customize the Map. So what I need to do first, like the Data Table, I need to scroll down to the data source section and I need to create the query. So I want to query the Account object. Perfect. Then let's configure the mapping. It's already there by default, I get a preview displaying all the accounts. I don't want to have this list view, so I will just scroll down, scroll up to the list view settings, hidden. Okay, that's good, but that's not what I want. I want to only display one account, not all the accounts. So I need to filter the Map based on the account selection I made on the Data Table, and that's where the reactive part comes into play. So on the filter side, I
need to add a condition. Filter by the field, which is the account ID. I want to only display the selected record ID of the Data Table, so I will select the account ID field, and for the value I need to enter the reactive expression from the Avonni components. We have a bunch of documentation in place for that, and I will show you the documentation website in just a few minutes. So I need to type the expression, which is like the Experience SL expression. So I need to first type the API name I set up on the Data Table, so it's this one. Then I need to type the selected record, and then dot ID. What is the field? I need to specify the field I need to use for the selected record, so I need to use the ID of the selected data from the Data Table. Save. Okay, I filtered information, the Map is updated live. I would just play with the zoom level, because I really want to focus. Let's say I have a zoom level of maybe 11, which would be like the city level. So okay, that's great. Let's do a quick preview. So now if I'm selecting an account, nice. So as you can see, the Map is updated live on the Experience Cloud site. I'm not using a flow, I'm really using native Avonni components that are reactive. So here on my example you can see that the Avonni Data Table is communicating with the Avonni Map, based on the setup I've just done a few seconds ago in this video, and it's working perfectly fine.
Now if you'd like to learn more about how to set up reactive data components, we have a documentation website regarding the Avonni components for Experience Cloud, and we have the reactive data components page, where you can see a lot of information about what the reactive data components are, which ones are reactive, and some examples to replicate this on your side. That's pretty much done for this demo regarding Experience Cloud components. Let me know if you have any questions in the comment section below. Thank you so much, bye-bye.
Give the Avonni Data Table an API name, then in the Avonni Map filter, use a reactive expression with that API name, the selected record and .Id as the value.
Set Max Row Selection to 1, which shows radio buttons instead of checkboxes.
Use the Avonni Layout and set the column sizes, such as 8 and 4 of 12; the video uses an LWR site for the layout and slots.
Browse the whole library, filtered by where it runs and what you want to build.
All video tutorials