PowerApps multiselect cascading dropdown and save an item to SharePoint List

 I have one scenario as below

List 1: Division List has title field

List 2: District List has Title and Division Field(LookUp from Division List)

List 3: Facility List has Title, District Field(LookUp field from District List)

List 4: County List has Title, Facility Field(LookUp field from Facility List)

Main List:

Spill Report is the main list 

Division Field( Look up from Division List)

District Field(Look up field from District List)

Facility Field(Look up field from Facility List)

County Field(Look up field from County List)

List Screenshots provided below can be refered for clarification.

-----------------------------------------------------------------------------------------------------

PowerApps Canvas Apps

In Power Apps Canvas App, We need to first design the app with the 4 respective fields
Since those fields are multiselect, then it is to combo box.

Generally power apps are not supported for multiselect cascasding dropdown.
Refere microsoft documentation, Know Limitation section.

Now I have did some work around in custom approch.



Step 1:

Across each list, I have created one caliculated column
For eg:
Division List: 
Number field holds number in series of unique values.
DivisionValue field is a caliculated column with formula as <Number Field> - <Title field>
Refer screenshot to the list.
Similary we need to create this Number field and DistrictValue in District List.
Number field and FacilityValue in Facility List.
Number field and County Value in County List.

Step 2:

Now we need to Populate the values in the respective dropdown.
Field 1:
Division Field
item property:

OnChange property:


In OnChange property, I have created a collection named DivisionCol which holds the multiselected values selected in the collection

Update property:

In the datacard section - Update property - as above screenshot.
--------------------------------------------------
Field 2: District Field
item:
Filter(District, 'Division:DivisionValue'.Id in Concat(DivisionComboBox.SelectedItems,Value & ","))
OnChange:
ClearCollect(DistrictCol,Split(Concat(DistrictComboBox.SelectedItems,DistrictValue & ","),","));
Data Card - Update Property:
ForAll(DistrictCol,
    {
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Id: Value(LookUp(District,IDValue in Split(Result,"-"),ID)),
        Value: DistrictComboBox.Selected.DistrictValue
    }
)
----------------------------------------------------
Field 3: Facility Field
item:
Filter(Facility, 'District:DistrictValue'.Id in Concat(DistrictComboBox.SelectedItems,DistrictValue & ","))

OnChage:
ClearCollect(FacilityCol,Split(Concat(FacilityComboBox.SelectedItems,FacilityValue & ","),","));

DataCard: Update:
ForAll(FacilityCol,
    {
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Id: Value(LookUp(Facility,IDValue in Split(Result,"-"),ID)),
        Value: FacilityComboBox.Selected.FacilityValue
    }
)
----------------------------------------------------
Feild 4: County Field:
Items:
Filter(County, 'Facility:FacilityValue'.Id in Concat(FacilityComboBox.SelectedItems,FacilityValue & ","))
OnChange:
ClearCollect(CountyCol,Split(Concat(CountyComboBox.SelectedItems,CountyValue & ","),","));

Data Card Update property:
ForAll(CountyCol,
    {
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Id: Value(LookUp(County,IDValue in Split(Result,"-"),ID)),
        Value: CountyComboBox.Selected.CountyValue
    }
)
-----------------------------------------------



List name: "Division"


List 2 is "District" List


List 3: Facility List



List 4: County List


Main List "Spill report"









Comments