Dependent picklists in a screen flow with the Avonni Combobox, plus a formula that disables a field.

Use the Avonni Combobox for dependent picklists in a screen flow, with options that follow earlier choices. For Salesforce admins who build forms with linked fields.
Hello, and welcome to this new tutorial video of the Avonni Components for screen flows. Today I'm going to show you how to configure and set up the Avonni Combobox. So the Avonni Combobox combines a drop-down list where users can make a selection, but you also have access to various settings for the Combobox, like having a search engine, being able to select multiple items, and also, that's what I'm going to show you today as well, making sure comboboxes can work with a dependent picklist field, if you have a dependent picklist field. So right now, as you can see on my example, if I'm selecting, let's say, Toyota, you will see related models based on the car maker Toyota. The same for Tesla: if I'm selecting Tesla, you would see related models. And then, if I'm selecting a model, I will see related information, because I configured a reactive part with the Data Table to display corresponding information based on the selection made. And I will show you another thing regarding the Combobox: how to disable a Combobox using a formula text field, a formula Boolean field,
sorry. So let's create that from scratch. So let's create a new screen flow right there, and here I will select the Screen element and start configuring my screen element. Screen one. Let's add a Section component, because I'd like to be able to drag two components next to each other. So I will add a column, and now the first thing I need to drag is the Avonni Combobox for the left side. And on my example, I want to display the car makers. So car maker, open Component Builder, and let's configure the Combobox element. So let's select the car maker. So that's the label. You will see the label right there. Now I need to configure the component. Right now there is no data connected to the component. You need to scroll down and select the data source. From there, you need to select the data source you'd like to configure. For example, I'd like to display car maker, and on my Salesforce, car maker is a picklist field. So we select Picklist. I created a car custom object, and then select the picklist field, car make, car maker. I can instantly see the preview of the values returned by the Combobox, which is nice, because I can see if that makes sense or not. If you have a record type, you can say, oh, I have a record type, and select the record type you'd like to display. Sort order as well, if you want. You can also add more advanced settings, like search, so you will be able to type the first letters of the value you'd like to select. Is multi-select as well, so being able to select multiple car makers, that's possible. Okay, great. So, and I'm just done. I just configured my first Combobox. So now let's do the same for the other Combobox on the right side, that will display models of cars based on a dependent picklist. So we drag the Combobox once
again, and let's name it car model. Open Component Builder. Okay, select a car model. I will do the same: data source, picklist, from the car object. Picklist field, it's model. But the picklist field car model, it's a dependent picklist. So I will select the record type, and now I have access to this controlling value attribute, because the Avonni Combobox detects automatically that model is a dependent picklist on my Salesforce. So what will be the controlling value? The controlling value should come from the value selected in the first Combobox. So from there you need to select car maker. This is the screen component, the Combobox screen component, I'd like to take the value from, and from there you're selecting value, the value attribute. That's it. From there it will automatically, it's obviously not displaying in the canvas as a preview, but if we save that and save the flow, we can do a run to live test our demo. Right now I don't have any option for the car model. Let's select an item. Tesla, yes, perfect, it works fine. Honda, great. For the same, that's perfect. Now let's do another thing regarding the Combobox. What I'd like to do, I'd like to be able to disable the car model if there is no car maker selected in the first combo
box. So I'd like this to be disabled by default, so users won't be, you know, confused if they need to select a car maker or car model first. So let's get back here, and to make this happen, you need to create a formula variable. So New Resource, Formula. It will be a Boolean formula. So let's name it is controlling picklist selected, and now let's insert a Boolean formula. And what could the formula be like? So the formula should be ISBLANK, and then you're typing what you'd like to insert inside, to check if it's blank or not. What you need to check, if it's blank or not, is the car maker value attribute. So basically, if the car maker value attribute from the Combobox is blank, that's true. That's what the formula will return. So now I'm going back on the screen component, select the car model Combobox, and here you have a disabled attribute. So you can check that or uncheck that, but that's not exactly what we want. We want this disabled attribute to be dynamic, based on the result we get from the Boolean formula we just created. So here I need to map the formula created to the disabled attribute. So let's do again a quick test. So I have my two comboboxes. As you can see, the car model Combobox is disabled by default, because it's based on the attribute, the formula Boolean attribute, that is checking if it's blank or not. So now let's do a test. Let's select an item. Yeah, now it's no longer disabled. I'm able to select a car model. That's pretty much awesome. Now, if you'd like to go deeper with this example, let's get back to my first demo. So let's go to the
first demo I showed you. It was this one. It's exactly the same. I can select a maker and select the model to get and to return results. So how I did that, basically what I did, I will show you that right now. On my screen component, what I did, I added the Avonni Data Table and just set up the basic Data Table setup with a query. So I'm querying the car object based on my C setup, and do the mapping to add corresponding information. But I want to dynamically filter the Data Table results based on a filter formula. So here on the query you have filters. I don't want to enter the filters manually. Why? Because I want the Data Table to be reactive, and to make this Data Table reactive, I need to map that to a formula text field I already set up. That will be my, it's like my WHERE clause on my query. So let's go see how I configured the filter car formula. So right there, filter C, that's my formula. It's everything inside my SQL query that comes after the WHERE. So basically I'm saying, filtering by WHERE car make, that's the API name of my field, is equal to the car maker value, and car model, the same, API name right there, is equal to the attribute of the Combobox, which is car model value. So if I want to repeat the exact same process, let's say I want to say, oh, car model is equal to what? Is equal to the Combobox value, car maker or car model, and the value attribute. That's it. That's the syntax of my formula for the filters. And then you just need to map that formula into the Data Table filter option, to be able to dynamically filter the Data Table results based on the selection made in the Combobox you have at the top. So let's get back on the example once again. Let's select an item, a car maker, a model, and now you can see the Data Table is displaying automatically, based on the reactive filter I set up using my formula text field. Again, if I'm going back on my flow, what I did next, I added the Illustration and configured the Avonni Illustration with some visibility rules. So basically I'm saying that, oh, I only want to display the Avonni Illustration if the car model value from the Combobox is null, and also if the car maker value of the Combobox is not null, because it's false. So that's a component visibility rule. That's how I did that, and that's how basically you can set up and configure the Avonni Combobox for your needs. Thank you, and if you have any questions, feel free to write a comment just below. Thank you. Bye-bye.
Set two Avonni Comboboxes to the Picklist data source, and on the dependent one select the record type, then set the controlling value attribute to the value of the first Combobox.
Create a Boolean formula with ISBLANK on the first Combobox value attribute and map it to the disabled attribute of the second Combobox.
Write a Text formula that holds the part of the query after WHERE, comparing your fields to the Combobox value attributes, and map it to the Avonni Data Table query filter.
Browse the whole library, filtered by where it runs and what you want to build.
All video tutorials