Video tutorials
/
Build a Dynamic, Reactive Map in Salesforce Screen Flows with Avonni Components: No Code
Screen Flows

Build a Dynamic, Reactive Map in Salesforce Screen Flows with Avonni Components: No Code

A screen flow with a map of accounts and a details panel that updates when you select an account.

Beginner
14:32
Tutorial
Build a Dynamic, Reactive Map in Salesforce Screen Flows with Avonni Components: No Code
Play video
Chapters
0:00 Introduction 0:35 Final Result 1:19 Creating a screen flow 1:25 Adding a Get Records Element 2:05 Adding a Screen Element 2:25 Adding a Section 3:05 Configuring the Avonni Map 5:35 Configuring the Avonni Illustration 8:10 Configuring the Avonni Header 9:47 Configuring the Avonni Formatted Value 13:17 Adding our flow on a home page using App Builder
Click a chapter to jump to it
Watch on YouTube

What you will build

Build a screen flow that shows accounts on a map and updates a details panel when you select one. For Salesforce admins who want a visual screen on a home page, built in Flow Builder without code.

  • A Get Records element that loads the accounts
  • The Avonni Map, configured to show each account
  • A details panel built with the Avonni Illustration, Header and Formatted Value
  • Details that update when you select an account on the map
  • The flow added to a home page with Lightning App Builder

Transcript

0:00 Introduction

Hello everyone, I'm servic, customer success manager here at Avonni. So in this tutorial I will build a component using the Avonni Flow Screen Components library to showcase a Map that displays a list of accounts, and this component will also be fully reactive, meaning that when I'm selecting an account on the Map, it will automatically display related information on that account under the same component. So that's extremely useful and powerful. Let me show you the final result.

0:35 Final Result

So this is the final result of what I'm going to build in this video. As you can see, it's a custom component, but on the back end it's a flow, and here I'm only using Avonni components from the Avonni Flow Screen Components library. And this component is fully working. I mean, if I'm selecting an account, I'm automatically getting related information on this side. The same if I'm changing the account name. As you can see, it's fully reactive, no refresh needed, and the account information is displaying on the Map as well as on this right panel. So let's dive into building this in Flow

1:19 Creating a screen flow

Builder. So the first thing we need to do, we need to create a new flow and select Screen Flow.

1:25 Adding a Get Records Element

So the first thing we need to do here is to fetch data information from the account on Salesforce, and to fetch data information, we need first to add a Get Records element. So Get Records, it's pretty easy to set up. Get Account. So just select the object you'd like to fetch data from, and here, if needed, you can set conditions. So if you only want maybe to display a specific account, you can set conditions to only display specific accounts. For this example I want to display all accounts, so all records. Done. Perfect. I just set up the Get Records information. Next,

2:05 Adding a Screen Element

the screen element. So let's add the label. Because I want this component to act like a custom component, I don't need the Header, I don't need the Footer. And now the first thing we need to do is we need

2:25 Adding a Section

to add two sections, because if we remember our example, we have the Map, and on the right side we have specific related information. So for that we need to drag a section element. So the section will help you to create different sections inside your screen. So add a column, set width, and now you have two columns. So that's easy to drag any of the components inside. When you install the Avonni Flow Screen Components managed package from the AppExchange, you will find all our components here under Custom, so it's natively integrated into Flow Builder. So first thing I need to do

3:05 Configuring the Avonni Map

is drag the Avonni Map component. For each of our components, we built what we call a Component Builder, meaning that you get access from here, Open Component Builder, to all the component settings. You also get access to a preview. So to set up the Map component, I need to ensure that the mode is the correct mode. So here I want to display multiple markers on the Map, so we select multiple markers. If needed, you can adjust the zoom level. So let's say you have all the accounts that are located under the same country, you may want to zoom to that specific country by adjusting the zoom level. Then expand the Header section: account, the title, icon name right there. If needed, you can add actions, so that's button actions you can add right there, and then set interactions using the Interactions tab on those buttons. Value settings, filtering, search engine: let's say you'd like to make your items searchable, you can add a search engine right from there. Now the most important part of this Map component is to link the data coming from the Get Records collection to the Map component. So that's the data source. Then you can select variable and link that variable to the Get Records collection, and finally you can do the mapping. So as you can see, it's already pre-filled based on the data coming from the Get Records collection. Title would be the account name, description would be the record description. You can adjust if you want, you can change the field, that's easy. Location: make sure that you're selecting the correct field, because that's what we will use to display the correct location of the account. Finally, you have filters. So let's say you'd like to add a filter to filter by country. That's easy. Type, let's say, countries, select the billing country field, and you will have the billing country field available to filter by country. Done. I just set up in two minutes my Map component. So now if we go back to our example right there, let's refresh that page. We can see that we have like this

5:35 Configuring the Avonni Illustration

Illustration displayed, but that's the reactive part for this component. The Illustration will only be displayed if no markers are selected. So let's go back to Flow Builder again, and here I will use, we have a component for that of course, the Avonni Illustration. So Illustration, Open Component Builder, set a variant, let's see, in Open Action for example. Okay, "No marker". Good, yes. Okay, that's done. I mean, I don't need to do any more stuff on configuring the Illustration component. Now one important thing to do is to configure the reactive part, because we want the Illustration to be only displayed if no markers are selected. So for that we need to go on this Set Component Visibility and set a component visibility. A quick note here, that's really, really important. Make sure that if you're going to the Process Automation Settings under the Setup menu that the... so yes, make sure that on the Process Automation Settings here under the Setup menu, the opt-in to reactive screens beta is checked, otherwise it won't be available. If it was not checked before, you might need to recreate your flow from scratch. So let's get back to Flow Builder again, and here let's set the component visibility. So the condition would be, okay, show me the Illustration only if, on the Avonni Map, the selected marker sObject value, which field, the account ID, and then we select the operator is null, true. That's it. I mean, with that condition the Illustration will only be displayed if no markers are selected. So now we can really focus on bringing our other component below, which would be the Avonni Header.

8:10 Configuring the Avonni Header

So let's drag the Avonni Header right there. I have a Header, and then Open Component Builder. So here on the Header we want to display the selected account name. So it's the title, but the title, we cannot enter the title manually because it needs to be dynamic based on the selection I've made on the Map. So for that I will select here Map, take the resource Avonni Map, the same way, going to the selected marker sObject value, account name. Done. Again, for the Header we can add an avatar, and we can also play with the style. So let's say on the Styling panel, you will get all the styling group settings for this specific component. So if you want to configure the branding, that's easy to do it. I will just here add the margin bottom, small. Done. Last piece: configure the reactivity the same way for the Header, because again I want the Header to be displayed, only this time when a marker is selected. So Set Component Visibility, condition, we are doing the other way around, so account ID is null, but this time false. Great. Now we want to display specific

9:47 Configuring the Avonni Formatted Value

fields information, and for that I will use the Avonni Formatted Value component. Value, so the label will be Account Type. Text value: again, the value should be dynamic, so we'll say like Map, the exact same way, yeah, and then select the account type field. Going into the style, we can adjust the styling. Let's say we'd like to add a border, we can add a border on the bottom side, one pixel, style solid, set the color, this gray, and we can also add a margin and padding. Perfect. The same way, configure the Set Component Visibility, this time the exact same way as the Header. Yeah, Map account ID is null, false. Okay. And if you want to repeat the same process to add more Avonni Formatted Values, you just need to drag another Avonni Formatted Value component, but this time it will be exactly like this one. So what you can do, and that's really a handy feature, you can click here and copy the configuration of this component, and then you can paste that configuration into the new component. So let's say Account Industry value. So everything will be already set up, we just need to change the label and the value. Then you still have all the styling, it's staying the same. And then industry. Don't forget to set the component visibility to ensure that it will only be displayed when a marker is selected. So Avonni Map sObject value is null, false. So I'm pretty much done, I think. Let's save that, and next, save the flow and activate that flow. Okay, the flow is activated. So now this flow is available to be added anywhere on Salesforce where you can add a flow, and let's do it on a record page, or even

13:17 Adding our flow on a home page using App Builder

better, on the home page. So to add this component we just created as a flow to any page, any pages like the home page or any record pages, we just need to open the Lightning App Builder from Salesforce. So here, Edit Page, and from there you would just need to drag the Flow component. Okay, Flow, and select the flow you just created. Save, and we are here, we have our component. Let's test that. It's working, it's working well. We can even search by country. Great. So that's how you can use the power, or even better, the powerful combo of Flow Builder and the Avonni Flow Screen Components library. So feel free to add any comment or question. If you're stuck somewhere, let us know in the comment section just below. Thank you so much, bye-bye.

Show the full transcript

Questions this video answers

How do I show details of the marker selected on a map in a screen flow?

Map the components to the Avonni Map's selected marker sObject value, for example Account Name for an Avonni Header title. The screen updates when you select a marker, with no refresh.

Why can't I set component visibility on the selected map marker?

Check that the opt-in to reactive screens is checked in Process Automation Settings in Setup. If it wasn't checked before, you might need to recreate your flow.

How do I filter map markers by country?

In the Avonni Map Component Builder, add a filter (here Countries) on the Billing Country field.

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