Video tutorials
/
How to Build Reorderable Lists in Salesforce (Avonni List + Flow)
Screen Flows

How to Build Reorderable Lists in Salesforce (Avonni List + Flow)

A drag-and-drop list in a screen flow that saves the new order back to Salesforce, shown on a backlog.

Intermediate
11:00
Tutorial
How to Build Reorderable Lists in Salesforce (Avonni List + Flow)
Play video
Chapters
0:00 Introduction 0:49 Final Result 1:29 Building the Flow 2:12 Adding and Configuring the Avonni List Component 4:55 Implementing Reordering and Saving: "Update Records Order" 7:35 Make Items clickable & other settings 8:39 Testing and Demonstration 10:24 Recap and Conclusion
Click a chapter to jump to it
Watch on YouTube

What you will build

Build a list in a screen flow that users reorder by drag and drop, with the new order saved to Salesforce. The example is a product backlog, for Salesforce admins who manage priorities.

  • The Avonni List with a query data source
  • Drag and drop reordering
  • The Update Records Order interaction to save the new order
  • A Refresh Query interaction so changes show right away
  • Clickable items and other list settings

Transcript

0:00 Introduction

Hello everyone and welcome, it's been a while. So in this tutorial we will see how to build a dynamic reorderable user story backlog right inside Salesforce, and for this we'll be using the Avonni components to make this happen. So imagine having your team managing their user stories, so they can simply drag and drop to change priorities, and the change will happen automatically, instantly. So no more clunky spreadsheets or manual updates. And by the end of this video, you will know how to create this powerful custom solution for your own team, boosting their creativity. Let's jump in and get

0:49 Final Result

started. Let me show you the final result of what I'm talking about. So this is my project page on Salesforce. I have it like a backlog tab, and here I'm using the Avonni List to display a list of user stories based on a specific project. And with that List, as you can see, items are reorderable, so I can select an item and boost the priority directly to the first one. As you can see, the changes happen instantly. So when I drag and drop an item, it will automatically change the order, the priority, the backlog order I have on my item. So I will show you how I built that using the Avonni List. Okay, let's do it from scratch. Create a new flow.

1:29 Building the Flow

Flow, scratch, Screen Flow, create. Now, first I need to create a variable. So basically it's an input variable, a text variable, just to capture the current record ID I want to display this component on. So the name of the variable, it's input for me, available for input. So with that variable I will be able to pass the current ID as a variable on my screen flow. Okay, now let's create a Screen element. Let's enter an API name. We remove Header and Footer, and all we need to do

2:12 Adding and Configuring the Avonni List Component

for this example, it's just simply the Avonni List. So I will drag the Avonni List. API name: list. Open the Component Builder, and now let's configure the List. First thing I need to do when using the List, I need to connect my Salesforce data with the component. So here I will do a query on the... that's a custom object I have, so it's User Story. Okay, I want to filter that with the current record ID. So in my case it's a custom object, so I need to filter by the project object record ID, is equal to, Map. That will be the input variable I just created before to capture the current record ID of the project I'm placing this component on. Save. Okay, so now let's do the mapping of the List. What I want to display as a label: I would select the fields I want to display, that would be user story name. Okay, then I can say for description, let's add summary description. Perfect. If needed, you can really fine-tune the mapping by mapping other attributes on the List. You have like avatar, you have also image, SCE, checked, info, so there is a lot of information you can add on the List. We can add, for example, icon. Let's pick up an icon. Let's see, list, or maybe items. And also for Fields, I will select... because I want to display other fields: instead of just displaying the name and the summary, I'd like to display also the backlog priority number. So basically that's the field, that's a number field I will use to make sure it will follow the same order for the List. That's really important. Okay, now let's fine-tune the look and feel of the List. I will use divider. So here you have the ability to select the divider for the List. So let's say bottom. You will have like this bottom line. You can make items clickable. You can show the number of items that will be displayed right at the top. Either you can say, okay, demo backlog items for the Header. Okay, now that's mainly for the look and feel of the List. Another thing I need to do, I need to

4:55 Implementing Reordering and Saving: "Update Records Order"

make items sortable, or being able to drag and drop items to change the order. And for that you have a specific setting, which is Sort. You're expanding the Sort settings and you can make items sortable, and with that you can select an icon you want to display for sortable items. So let's select an icon, so users will be able to understand, oh, they can move items using their mouse. So let's pick up an icon. There's a lot of icons available. This one. Okay, so now you can see there is like the mouse. I can easily... because I enabled sortable, you can easily make items sortable. You can even sort it by value if you want, but for that you need to add another by. So now, next step to make this work: on my data source section, I need to select an Order By field. If you want to save on reorder when you're dragging items, you need to specify a field where you'd like the items to be ordered by. So here the name of the field, in my case, it's a number field, which is backlog priority. Direction ascending, and save. So now it's ordered by the backlog priority number. Okay, perfect. Almost done, almost functional. Now I need to define the interaction. So I need to define what will happen when users are dragging an item or are changing the order of an item within the List. For that I will go to Interactions, and we have a specific interaction for that, which is Reorder. So that's the one you will use to create the interaction, to trigger what will happen for users when they're reordering items. So add a Reorder interaction, and for that I will select Update Records Order. That's the interaction I need to use. You have some information, very important, especially if you're using the variable data source: to make sure that you have the sorted by or sort direction set up on the variable. The same for the query, which I use: I need to rely on the Order By. This is what I did by selecting the backlog priority order. Save. So now the information will be saved automatically if users are dragging items to change the order of items on the List properties. Quick note here: what

7:35 Make Items clickable & other settings

I did right there, I made items clickable, that's why I have this link. Make sure not to forget to do that if you really want to make this functional. For the link, you need to create an interaction on Item Click, and for that you need to set the interaction to Navigate to the record page, and select the object you'd like users to navigate to, which record ID will be based on the record ID of the item, and View the record. Save, it's done. I mean, you have other options if you want to explore, like layout, the number of items you'd like to display by column, avatar, images, fields layout. So fields layout, for example, if you want to display multiple fields, or if you want to set the variant of the field layout, let's say label inline, you will see the information like this. So now let's save my flow. Okay, and let's activate the flow. Right

8:39 Testing and Demonstration

now, last step, I will just add the Screen element, the Flow element, into my record page to be able to get access to what I just did using a screen flow. Okay, so now I want to add the screen flow I created into the page, into the project page. So I'll go on Edit Page to open App Builder. What I will do, I will select... okay, this is already a tab set, a Tabs element. I will add a tab and name it, custom, that would be like backlog. And now I will just drag the Flow element and select the flow I want to display here. So the name of my flow: demo reorder list. Make sure here to check pass the record ID into the variable you've configured into the flow. Save the information, and now let's go back to the record page. Backlog, demo backlog items. Okay, perfect. So now let's say I'd like to change the backlog, user story backlog items, the fifth one to the first place, first order. Saved. So if I'm reloading the page, I should see right now the item five. Yes, backlog priority, it was automatically changed to one. So that's really important for that: to make sure you have a priority number field you can use for the reordering, and an Order By on the List. And that's it. So we successfully... okay, and

10:24 Recap and Conclusion

that's it. We successfully created a dynamic reorderable user story backlog using the Avonni components. So now your team can easily prioritize user stories, or any other items you have on your Salesforce, with a simple drag and drop, and those changes are saved instantly to Salesforce. Thanks for watching. Let us know if you have any question in the comment section below. Have a nice day.

Show the full transcript

Questions this video answers

How do I let users drag and drop to reorder records in a screen flow?

In the Avonni List, turn on sortable in the Sort settings, set Order By to a number field, and add a Reorder interaction with Update Records Order.

Which field does the Avonni List update when items are reordered?

The field set as Order By in the data source, here the backlog priority number field in ascending order; with a variable data source, set the sorted by and sort direction on the variable.

How do I show only the records related to the current record in an Avonni List?

Create a Text input variable, filter the query on the parent record ID equal to that variable, and check Pass the record ID into this variable on the Flow component.

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