Overview
I have come across a scenario where we need to make cascading dropdown for our form.
I have two columns in the Dataverse table named – Locations and Store Name. Both Columns are Look Up columns.
Below is the master table for Locations.
Below is the master table for Store Names with Locations as Look Up Columns.
Now, in the form based on the Locations, we want to filter our store names.
Let’s get started!
Step 1
Open the form control and check the code for the first Look Up Column – Locations.
For Items -below is the default code
Choices([@'Performance Reviews'].ppt_Location)
Step 2
Write on the change event for the Locations dropdown and find all the stores from actual Store Names tables.
ClearCollect(
colstoreNames,
ShowColumns(
Filter(
'Store Names',
Location.Loc = DataCardValue17.Selected.Loc
),
"ppt_storenamesid"
)
);
Step 3
Open the Store Locations Dropdown and change the Items code like this:
Filter(Choices([@'Performance Reviews'].ppt_StoreName),ppt_storenamesid in colstoreNames)
Step 4
Test the code,
Change value from Look Up Column. It will change the value in another look up column dropdown.
Conclusion
This is how we can apply cascading dropdown for Dataverse Look Up columns!