Video tutorials
/
Create an Interactive YouTube Playlist in Salesforce Screen Flows: No Code with Avonni Components
Screen Flows

Create an Interactive YouTube Playlist in Salesforce Screen Flows: No Code with Avonni Components

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

Beginner
9:13
Tutorial
Create an Interactive YouTube Playlist in Salesforce Screen Flows: No Code with Avonni Components
Play video
Chapters
0:00 Introduction & Final Result 1:00 Custom Object overview setup 1:30 Creating the screen flow and adding a Get Records element 2:01 Adding a Screen Element 2:42 Configuring the Avonni List 4:50 Configuring the Avonni Illustration 6:03 Creating a formula to dynamically generate the youtube link 6:45 Configuring the Avonni Video Player 8:04 Adding our flow on a page using Lightning App Builder
Click a chapter to jump to it
Watch on YouTube

What you will build

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.

  • A custom object that stores the videos, loaded with Get Records
  • The Avonni List, configured to show the videos
  • An Avonni Illustration for the empty state
  • A formula that builds the YouTube link of the selected video
  • The Avonni Video Player, and the flow added to a page with Lightning App Builder

Transcript

0:00 Introduction & Final Result

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

1:00 Custom Object overview setup

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,

1:30 Creating the screen flow and adding a Get Records element

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,

2:01 Adding a Screen Element

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,

2:42 Configuring the Avonni List

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.

4:50 Configuring the Avonni Illustration

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.

6:03 Creating a formula to dynamically generate the youtube link

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,

6:45 Configuring the Avonni Video Player

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.

8:04 Adding our flow on a page using Lightning App Builder

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.

Show the full transcript

Questions this video answers

How do I play a YouTube video in a Salesforce screen flow?

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.

How do I show a component only after the user clicks an item in a list?

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.

How do I display custom object records as a clickable list in a screen flow?

Fetch them with Get Records, set the Avonni List data source to Variable with that collection, map the fields, and turn on Enable Click.

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