Hi!
I have a gallery which is connected to a SharePoint List. I want to filter the results down based on the values in these dropdown boxes.
For example:
- List
- ABC, UK, Office Supplies
- XYZ, USA, IT Software, Legal Software
- 123, UK, IT Software, Legal Software
- 456, Germany, Office Supplies
- MNO, Germany, IT Hardware
- TUT, France, IT Hardware
- RSD, UK, IT Software, HR Software
- Dropdowns
- Location
- Vendor Type
- Software Type (only visible if Vendor Type is "IT Software")
I want to be able to filter using the drop downs independently and also together.
So that if I chose Location only and selected "UK" the results would be:
If I was to select UK as the location and IT Software as the Vendor Type the results would be:
And if I was to select UK as the location, IT Software as the Vendor Type and the Software Type as HR System, the results would be:
Here is my code. However, the filters stop working as soon as I select a second filter. What should the correct code be?
If(
//All, All, All
LocationDrop.Selected.Value = "Choose a location" And VendorTypeDrop.Selected.Value = "Choose a vendor type" And SoftwareVendorTypeDrop.Selected.Value = "Choose a software vendor type",
'Vendor App',
//Location selected, Vendor and Software not
LocationDrop.Selected.Value <> "Choose a location" And VendorTypeDrop.Selected.Value = "Choose a vendor type" And SoftwareVendorTypeDrop.Selected.Value = "Choose a software vendor type",
Filter('Vendor App', 'Location'.Value = LocationDrop.Selected.Value),
//Vendor selected, Location and Software not
VendorTypeDrop.Selected.Value <> "Choose a vendor type" And LocationDrop.Selected.Value = "Choose a location" And SoftwareVendorTypeDrop.Selected.Value = "Choose a software vendor type",
Filter('Vendor App', 'Vendor Category'.Value = VendorTypeDrop.Selected.Value),
//Software selected, Location and Vendor not
SoftwareVendorTypeDrop.Selected.Value <> "Choose a software vendor type" And LocationDrop.Selected.Value = "Choose a location" And VendorTypeDrop.Selected.Value = "Choose a vendor type",
Filter('Vendor App', 'Software Sub Category'.Value = SoftwareVendorTypeDrop.Selected.Value),
//Everything Selected
Filter('Vendor App', 'Location'.Value = LocationDrop.Selected.Value And 'Vendor Category'.Value = VendorTypeDrop.Selected.Value And 'Software Sub Category'.Value = SoftwareVendorTypeDrop.Selected.Value)
)