Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
How to implement a cascading dropdown on a list with PowerApps - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2018-11-20

In this post, we will see how to implement a cascading dropdown list within the PowerApps application for a list with the two lookup columns where it has to display only the parent values if there are any associated child items.

List data setup:

  • SharePoint list “CarGroup” with the following data.
    • Tata Motors
    • Fiat Chrysler Automobiles
    • Apple
  • SharePoint list “CarBrands” with the lookup column “CarGroup” – with the Title column.
    • Alfa Romeo : Fiat Chrysler Automobiles
    • Landrover : Tata Motors
    • Fiat : Fiat Chrysler Automobiles
    • Jaguar : Tata Motors
  • SharePoint list “Car” with the lookups columns for the above lists and other data
    • Discovery :  Jaguar : Tata Motors 

We want to display the list of car groups and brands as a cascading dropdown and display the list of car groups which have an associated brand. By default the list form displays all the CarGroups as below.

Customise the Form using the PowerApps:

  1. Customise the Form

 

2. Add the CarGroup and CarBrand list as a Data source

 

Set the Group DataCard and Dropdown Items (First Level):

  •  Set the Group DropDown field items:

“Filter(Choices(Cars.Group),!IsEmpty(Filter(CarBrands,CarGroup_x003a_Title.Value = Value))).Value”. This displays only the list of relevant groups which has some brands to it. So for the above mention Data list setup, it will display “Tata Motors” and “Fiat Chrysler Automobiles” only.  

Notice that there is Delegation warning as we are trying to filter it using the Lookup fields. Thanks to Eickhel Mendoza(@Eickhel) for helping me with the work around solution, I changed it to add a new column before filtering it. “Filter(Choices(Cars.Group),!IsEmpty(Filter(AddColumns(CarBrands,”CarGroupTitle”,CarGroup_x003a_Title.Value), CarGroupTitle = Value)))”

Set the Brand DataCard and Dropdown Items (2nd Level):

  • Set the Brand Dropdown field items:

“Filter(AddColumns(CarBrands,”CarGroupTitle”,CarGroup_x003a_Title.Value), CarGroupTitle = GroupDropDown.Selected.Value)” to display only the brands for the selected group.

  • Set the Brand DataCard to update:

Update : {‘@odata.type’ : “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”,Id:BrandDropDown.Selected.ID, Value :BrandDropDown.Selected.Title} to update the list item.

Custom List form:

  • The Group will display all the Car groups containing the brands (except Apple).

  • The Brand will display all the Car brands for the selected group.

(Visited 2,089 times, 1 visits today)

About the author 

Balamurugan Kailasam

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.