cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

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
Highlighted
Super User III
Super User III

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.

Highlighted
Super User III
Super User III

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

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (8,766)