Hello everyone,
I am having a scenario with SharePoint list having 2 fields which are Division Field and District field.
Scenario is based on multiple select cascading behaviour between Division field values, District field values (mulitple fields) has to get filtered.
Default sharepoint choice field (multiselect type) type field has some limitations.
SharePoin List structure:
Using Powerapps with Gallery control, I have acheived it.
Step 1: I have Division List, which has fields "Title".
Step 2: I have District List, which has fields "Title", "Division"(which is lookup column from Division List).
Step 3: I have Master List name "HSA Spill Reporting", Here now I have created the two fields as multiline text fields
1. Division Field(Multiselect)
2. District Field(Multi select)
Power App Design:
In Power Apps, I go with Canvas App.
I have added multiline text fields in to my canvas app as shown below. I have added "Plus" Symbol on right side of Division field and District field.
On Select of Plus symbol:
Set(_popup,true);
Set(DivisionGalleryViewing,true);
When we click on the plus symbol, I am showing an hidden gallery control on the screen.
(Screenshot 2)
|
Screenshot 1 |
|
Screenshot 2 |
In the gallery control, I am populating the Division List values.
Step 4: I have added gallery control, which is providing visible property as variabel DivisionGalleryViewing which is set to false.
Note:
This Screen OnVisible property, Initially I have declared a variable with false.
Step 5:
OnStart of the app property, I am loading all the Division List data and District List data to the collections as shown below.
Collect(ColDivisionDropdown, ShowColumns(Filter(Division, Status = "ACTIVE"),"Title"));
Here Status Active is the filter having in my case, You can ignore it.
Similary for District Field,
Collect(ColDistrictDropdown,ShowColumns(Filter(MaximoDistrict, Status = "ACTIVE"),"Title","Division"));
Step 6:
After adding gallery control in the form which shown above screenshot,
click on the GalleryDivision_1
Items property: Update with your collection name as shown below.
SortByColumns(ColDivisionDropdown, "Title")
On Plus button click we have to show this gallery, hence in visible property of the gallery add variable "DivisionGalleryViewing"(which will true/false)
Now with in the gallery control, add a checkbox field.
Now to this check box field, Text property will be ThisItem.Title, which shows title value from the collections which has mapped with gallery control.
It list out all the title values from the collection of Division List.
Now when user select the Division check box values
Step 7:
Now Similar way, we need to do it for District field as well.
Step 8:
District field multiline text field datacard name rename it as "Division_DataCardValue".
Now Gallery control of District, Items property:
We have to show all district values from District collection, but we need to filter among Division Data card selected values.
items property Formula :
SortByColumns(Filter(ColDistrictDropdown, Division.Value in Division_DataCardValue.Text),"Title")
District Field gallery filtered values.
Thank you.!
Please comment if you have any queries to check.
Comments
Post a Comment