A screen flow that lists videos stored in Salesforce and plays the selected one in a video player.

Build a playlist in a screen flow: a list of videos stored in a custom object, and a player that shows the selected one. For Salesforce admins who want media on a Lightning page without code.
Hello. I'm really excited to do another tutorial video for you regarding the Avonni Flow Screen Components library, and this time I'm going to show you how to build this nice looking custom component. Basically, it's a YouTube Playlist component. It's a flow, using Flow Builder and the Avonni Flow Screen Components library. So on this flow, that's fully functional, I'm using here, on the left side, the Avonni List component to display a list of videos coming from a custom object. And then on the right side, I'm using here first the Avonni Illustration to display a new situation, because there is no video selected. But I mean, you can select a video and it will automatically display the video using the Avonni Video Player, and I can watch this video very easily. The same way, I can change the video to, you know, watch this video right from there. So how I
built that inside free video, I will show you that in a few seconds. First, let me show you my custom object. It's video library. That's my custom object with video information, pretty basic: video title field, description field, YouTube ID, thumbnail. That's it. So now let's build that in Flow Builder in five minutes. Let's do that. Let's create our flow, our new flow,
Screen Flow. First step here: add a Get Records element to fetch my custom object information, to make it available in my flow. So get videos. Let's link that to the custom object. I don't need to filter or to set any condition. I really want to display all the videos from my custom object. All records,
done. Next, let's add a Screen element. First, enter a label. If you remember this example, it's like a custom component. I don't need the Header, I don't need the Footer. First step: drag this Section element to create basically two sections on my component, because we have on the left the Avonni List and on the right we will have the Avonni Video Player at corn. Let's set the size, and now, from there,
I can drag the List. Let's configure the Avonni List, pretty easy. Open Component Builder. The first thing we need to do is to link my data source for the List. So here I will use Variable, because I want to use my Get Records collection created previously. Select a resource, get videos, and now all I need to do is the field mapping. For the label, I'd like to display the video title field. Description, the description field. Image, thumbnail. And then for the name, I don't want to use this field. Instead I want to use the name. So basically the name is my unique ID for the List, and for that I want to use the YouTube ID I'm adding on my custom field. Pretty much done. One last step: maybe we can configure Enable Click for each item, so each item from the List will be clickable. And finally, we can go on Style. We can adjust the styling. So let's say item either, we can say, okay, font size 18, weight, let's see, bold. The same for the description, the style. Perfect. We can do other settings from Properties: divider, let's set it to bottom, so we have like this little bottom border. Pretty much done. I just set up the List to display all the video information based on the custom object, using the data source Get Records element. Next, let's configure the right panel.
First I need to drag the Avonni Illustration. Let's configure the Illustration, pretty easy. Illustration, open Component Builder. Yeah, no. Okay, done. Now I want the Illustration to be displayed only if no item from the List is selected. So for that I need to use reactive screens, and I need to set the component visibility. Set a condition: from the List, click item name, is null, true. Perfect. Next, I can drag the Avonni Video Player, but before that I need to create a formula resource. Why? Because I want to store dynamically the whole YouTube link. So let's do that right there.
New Resource, Formula. Let's name it YouTube link. Okay, Text. Perfect. Here, all I need to do is copy this, and then, so that's the link from YouTube, and here I just need to write dynamically the unique video ID I just added on my record. So here, resource: List, click item name. Okay, perfect. Done. So now I can go back to my screen element,
and from there we can drag the Video Player. I have only video player, so we do clear. Let's open the Component Builder. Source: I don't want to select the video manually, it's dynamic. So for that, I need to map the source to a specific value. Map, and then map that to my formula resource. We can say, okay, autoplay. We can even go on Style to set a minimum I one. And one last step: configure the component visibility. Display the video player only when, from the List, click item name is null, false. Meaning that the video player will only be displayed if I'm selecting an item from the List. Done. Now we can save the flow. Save, and then we can activate that.
One last step: now we need to add this flow on the page, and for that, that's easy. From the home page or from any record page, let's go to Setup, Edit Page, to open Lightning App Builder. Drag the flow, and here let's select the flow. I will need video player demo. Save, and let's see the result live. Perfect. I have the List with all the videos coming from my custom object, and if I'm selecting a video, autoplay is running. It's running fast, really fine. Changing a video, working fine as well. So that's really one of the few examples you can build using the Avonni Flow Screen Components library, 60 plus UI components. As you can see here, there are a lot of examples you can build. So if you have any questions, if you're stuck somewhere, I mean, leave us a comment below. Don't hesitate to like this video if you really enjoyed it. Thank you so much. Bye.
Store the YouTube ID on a record, build a Text formula with the YouTube URL and that ID, and map it to the source of the Avonni Video Player.
Use component visibility on the screen: show it when the Avonni List click item name is null equals false, and show an Illustration when it equals true.
Fetch them with Get Records, set the Avonni List data source to Variable with that collection, map the fields, and turn on Enable Click.
Browse the whole library, filtered by where it runs and what you want to build.
All video tutorials