Skip to main content

Power Apps Multiselect cascading dropdown field implementing with gallery control

 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

Popular posts from this blog

Powerapps overcome 2000 item limit from any datasource

First go through delegation concept https://tejasadventure.blogspot.com/2020/05/power-apps-understanding.html In powerapps, we observe by default 500 item limit has set with in the app level for any data source. In order to overcome, we have option to set the limit of 2000 item limit maximum in the app. Now using code, MaximoFacility is my data source name contains 3000 items. ColFacilityDropdown is the collection storing the count of items from data source. We expect to see more than 2000 items. Based on StartWith function filtering the data with respective to the charectors and numbers as mentioned below. Code: Place the below code in a button on select property. Add label with code CountRows(ColFacilityDropdown) ClearCollect(ColFacilityDropdown,Filter(Filter(MaximoFacility, Status = "ACTIVE"), StartsWith( Title, "A" ))); Collect(ColFacilityDropdown,Filter(Filter(MaximoFacility, Status = "ACTIVE"), StartsWith( Title, "B" ))); Collect(ColFacilit...

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 Limit...

Creating SharePoint List with columns and content types using Power Automate Flow

 Rest API Uri: https://gitbrent.github.io/SpRestLib/blog/2018/04/20/create-sharepoint-list-columns-using-rest.html Create SharePoint List: site address: Enter URL method: Post URi: /_api/web/lists headers: Accept:application/json;odata=verbose Content-Type:application/json;odata=verbose Body: {   "__metadata": {"type": "SP.List"},   "AllowContentTypes": true,   "BaseTemplate": 100,  "Description": "Admin configuration list",  "Title": "AdminConfigList" } -------------------------------------------------------------------------------------- Multi line text field: create a multiline text column: Site URL: Target Site URi: _api/lists/getbytitle('CI_CompanyNews')/fields Type: POST Body: {     '__metadata': {'type':'SP.Field', 'addToDefaultView': 'true' },     'FieldTypeKind': 3,     'Title': 'Blurb' } Headers:  Accept:application/...