Dependent Dropdowns – Collections – Show All
I need 2 dependent dropdows for my gallery which include an “All” Option.
The first dropdown is called ddCompany, which will look up the company column from my Sharepoint List and adds an “All” option. This works fine by doing the following:
- Created a collection to add all – using the formula:
ClearCollect(collectCompany, {Result: "All"});
Collect(collectCompany, Sort(Distinct('Property Database','Claimant Company'),Result),'Property Database' )
- On the dropdown ddCompany – using the formula – collectCompany
As a result of the first dropdown having an “All” option, I have split the 2nd dropdown (ddYear), into 2 sections
- When DDCompany = “All”- my formula for DDYear is collectYear_CompanyAll
The formula for collectYear_CompanyAll is:
ClearCollect(collectYear_CompanyAll, {Result: "All"});
Collect(collectYear_CompanyAll, Sort(Distinct('Property Database',’Financial Year’),Result))
This all works fine
My problem is the second section, this is:
- When DDCompany = a select item.
If I didn’t want to include “All” in this dropdown, the following formula works fine for the dropdown:
Distinct(Filter('Property Database',ddCompany.Selected.Result='Claimant Company').'Financial Year','Financial Year')
However when I try to add this into a collection, to add “All” as formula below, the collection doesn’t work
ClearCollect(collectYear_CompanySelect, {Result: "All"});
Collect(collectYear_CompanySelect, Distinct(Filter('Property Database',ddCompany.Selected.Result='Claimant Company').'Financial Year','Financial Year'))
Can someone please help me either with this collection formula or a better solution to the second part of the dropdown ddYear