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

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

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.

mdevaney
Super User III
Super User III

@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

@mdevaney,

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (37,867)