Video tutorials
/
How to Use Avonni On Load Interaction for Interactive Data Table Editing using Dynamic Components
Lightning Pages

How to Use Avonni On Load Interaction for Interactive Data Table Editing using Dynamic Components

Edit a Data Table row in a panel component that loads the record with an On Load interaction.

Advanced
10:13
Tutorial
How to Use Avonni On Load Interaction for Interactive Data Table Editing using Dynamic Components
Play video
Chapters
0:00 Introduction 1:24 Create a second, nested Avonni component (designed as a panel) 2:22 Variables creation process 3:24 Building the nested Avonni component 5:22 Button interaction setup 6:34 Implement the Avonni 'on load' interaction 7:53 Configure the Edit button interaction on the Data Table 9:02 Activation and Test
Click a chapter to jump to it
Watch on YouTube

What you will build

Build a panel component that loads a record when it opens, then open it from an Edit button on an Avonni Data Table. For Salesforce admins who build Dynamic Components with interactions.

  • A second, nested component designed as a panel
  • Variables that receive the selected record Id
  • A button interaction in the panel
  • The On Load interaction that fetches the record
  • An Edit button on the Data Table that opens the panel

Transcript

0:00 Introduction

Hello everyone and welcome to this new video tutorial about the Avonni dynamic component and today I will dive into one of the features we have in the dynamic components application. It's the onload interaction feature. So I will show you how this works with this specific use case. So here I am on a record page and I build this contact related list. This is not a standard related list. This is another dynamic component I place into this Lightning page and on this component I use a card and within the card I use a data table to display related information regarding contacts based on this account. And here what I did I placed this edit button next to each row. So what I like to do it's making this edit button functional. Right now, it's nonfunctional. And what I'd like to do is really being able to open another dynamic component as a panel when users are pressing this edit button. But to make this happen, I will need to pass the input variable of the selected row directly to the other component I am opening as a panel. So this is exactly what I'm showing you today. how to build another dynamic component and how to use the onload interaction to prepopulate data before the components load because that's really the goal of the unload interaction. Let's dive in. So here I

1:24 Create a second, nested Avonni component (designed as a panel)

will just open the Avonni components application from the app launcher and from there I will open my existing Avonni dynamic component. So you can see exactly the same. This is how I built it and this is also how I can really fine-tune and build this component more. So as I said I need to set the interaction on the edit. But before creating the interaction here on row action click I need first to create the other dynamic component I want to open using this interaction. Let's do it. Let's click on new. Let's say contact panel edit. That's the name of my component. I don't need to set up any target object here. Why? because I will not place this component into the contact record page for example. No. So here can click on create and now I can start building my component. So before drag and dropping the components I have on the left side I need to create my

2:22 Variables creation process

variables because here as I said my use case it's from the data table. Click on the edit button to open this component right there as a panel. So I need to create two variables. I'm going on the resources tab. Create a new resource. Select the type. The first one will be a variable that will store the contact ID that is pass through the data table to this component. So data type will be text. It's really important to make this variable available for input otherwise I won't be able to select it from the interaction on the data table. Save. Next, I need to create another variable, but this time it will not be a text type variable. It will be a record variable to be able to access to all the records information. So, I will be able to add those information into my component. So, let's say a contact record data type record and let's select the object contact. I don't need to set any available for input or output. I don't need that. Save. So, now I can start

3:24 Building the nested Avonni component

building my component. And why not by dragging a profile card? Okay. So here I have my attributes of the card title subtitle. So instead of typing manually the value, I will map that value to the existing value coming from the contact records variable I created just before to display full name. I would do the same for the title. Let's say I'd like to display the title coming from the contact record. So select as subject contact record and select the title field. That's it. Okay, that's for the profile card header. Now here I can access the fields information because I created the records variable. I will select the contact records variable. And now here from there I have access to all the fields information from the contact object which is pretty handdy. So here I can just simply drag and drop the fields I like to display on this component like being able to edit the full name, the department, why not about the mail address and why not about also the title. What I like the most here it's yes I can drag and drop fields but I also have access to all the components from the dynamic components to fine-tune the layout of this. So let's say for example I'd like to drag a column layout and I have like a two column that something possible and inside each column I can start dragging by dragging more fields. So here let's say I'd like to add the birth date and why not adding some related fields information from an obser object which is a parent object account ID and I want also to be able to edit the parent account ID information like why not editing the industry. Okay. So here we can fine-tune the look and feel column play with the spacing to add some space. Awesome. Perfect. One last

5:22 Button interaction setup

thing now let's drag the button group element right there and let's create our button group element. So let's say h and the second one would be save variant brand save and we can display the button group as row to have something like this which is more nice. So now what I need to do next it's really from the button to create the interaction to make sure the information would be saved on Salesforce. So here I will go on interaction on click select save and here I will select one of the interactions available from records variable operation here for my use case obviously I need not to create records because it would be displaying existing records but I need to update records update records from the contact records variable save that's it done oh so it's almost done but it's not done yet for the card for the profile card so for dynamic component I want to open as a panel because right now I'm displaying contact records name contact records email but I need to make sure the information will be load at first when the component load and this is exactly

6:34 Implement the Avonni 'on load' interaction

when you know the onload interaction comes into play because when you need to access records information before a dynamic component is displaying this is the way to do that and one of the common use case is this one where you'd like to open another dynamic component ment and being able to preload data from an input variable. So here on this interaction button we have the onload interaction and here from there you can create your own load interaction. Again it's really to preload specific data before this dynamic component gets loaded. So you have biometric if you'd like to use it on mobile and being able to make sure users get inert notified by face ID or by fingertips and also you can execute another lunch flow or also you can get records that's the one I would using I want to get records from the records variable contact records I created and what would be the the record ID I'd like to use I will select map and then the record ID would be this one the variable contact ID I created first Save. Let's save the component. Done for this part. Now, all I need to do, I need to get back to my first dynamic component and just create interaction on the data table for my users to be able to edit the contact and open this dynamic component as a panel. So, let's open the

7:53 Configure the Edit button interaction on the Data Table

data table. Let's create the interaction on the edit interaction on row action. Click here. I will select edit. And this is all the type of interaction you can trigger. Here I want to open another dynamic component as a panel. You can do exactly the same process if you'd like to open information using a flow. That's possible almost the same process. So open dynamic component panel and here I will uh panel edit and make sure to pass the input variable. So basically it's to pass the uh row contact row ID from the data table to the other flow I want to display as a panel. So input variable select the name that's the name of my input variable available for input I created on the other flow contact ID and what's the value I'd like to pass to this input variable I want to pass the contact ID and then you can really fine-tune the position of the panel the size let's make it large and on close let's say we'd like to refresh this editable content save and it's done so now we'll activate the component and let's see how it works live on a page.

9:02 Activation and Test

So I'm live on my record page. Now the dynamic components get gets loaded and here we can click on the edit button that's opening the other dynamic component as a panel as and as you can see the corresponding related information is already filled in thanks to the onload interaction I set up uh with you. So I can change the email address Cedric and change the um marketing and let's change you see the industry that's coming from the account object right now it's banking let's make a change let's change it to apparel save so it will save the contact information it will save the information directly from the account object which is the parent object and you can see the email address is also getting updated so that's what I'd like to show you today regarding the uh onload interaction and how you can use the onload interaction to preit database on an input variable to get a record information before the component is loaded. That's very handy especially for these kind of use cases. Let me know if you have any question and also if you like to give it a try to the a dynamic component, you have access to the link to the package on the video description. Thank you so much for watching.

Show the full transcript

Questions this video answers

How do I pass the selected row from a data table to another Dynamic Component?

Add a row action interaction of type Open Dynamic Component Panel and set its input variable to the row's contact ID. The variable in the opened component must be marked Available for input.

What does the on load interaction do in Avonni Dynamic Components?

It runs before the component loads, for example a Get Records or an autolaunched flow. Here it gets the contact into a record variable from the contact ID passed in, so the panel opens prefilled.

How do I save edited fields from a Dynamic Component panel?

Add a Save button with an on click interaction Update Records from the record variable that holds the fields; this also saved a field from the parent account.

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