cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
petergriac Helper II
Helper II

Dropdown field in Sharepoint custom forms

Hi all,

I need a help with my Sharepoint custom form.

I have following sharepoint list:

CATEGORY         SUBCATEGORY

Category 1         Subcategory 1

Category 1         Subcategory 2

Category 2         Subcategory 3

Category 1         Subcategory 4

Category 1         Subcategory 5

Category 2         Subcategory 6

Category 2         Subcategory 7             

 

And I have 2 dropdowns in my form:

CategoryDROPDOWN - looks to CATEGORY column in the list

SubcategoryDROPDOWN look to SUBCATEGORY column in the list. 

 

I would like to filter choice options for SubcategoryDROPDOWN based on CategoryDROPDOWN selection. It means that if user select "Category 1" from CategoryDROPDOWN, he would have only relevant options to choose from SubcategoryDROPDOWN.

Is that somehow possible?

I tried to set Items property in dropdown, but couldn't manage to do this.

 

Thanks a lot.

Peter 

            

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Dropdown field in Sharepoint custom forms

@petergriac 

Yes, this technique is called a "cascading dropdown".

 

I assume you are using a Dropdown and not a ComboBox.  Many people get these 2 controls confused.  My other assumption is the values in your SharePoint list are single-line text, not Choices.

 

Use this code in the Items property ofSubcategoryDROPDOWN to show only those matching values from CategoryDROPDOWN.

Filter(your_sharepoint_list, Category = CategoryDROPDOWN.Selected.Value).SUBCATEGORY

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
WarrenBelz Community Champion
Community Champion

Re: Dropdown field in Sharepoint custom forms

Hi @petergriac ,\

I will use your names and assume the Items of CategoryDropdown are from a list or collection also containing the SubCategory valueI will also call the source data Categories

The Items property of SubCategoryDropDown should be

Filter(
   Categories,
   SubCategory = CategoryDropdown.Selected.SubCategory
).SubCategory
   

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Super User
Super User

Re: Dropdown field in Sharepoint custom forms

@petergriac 

Yes, this technique is called a "cascading dropdown".

 

I assume you are using a Dropdown and not a ComboBox.  Many people get these 2 controls confused.  My other assumption is the values in your SharePoint list are single-line text, not Choices.

 

Use this code in the Items property ofSubcategoryDROPDOWN to show only those matching values from CategoryDROPDOWN.

Filter(your_sharepoint_list, Category = CategoryDROPDOWN.Selected.Value).SUBCATEGORY

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

petergriac Helper II
Helper II

Re: Dropdown field in Sharepoint custom forms

@mdevaney,

Thanks a lot. Is there also a way to have all subcategories if user doesn't select category?

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,815)