0

I am looking to filter a drop down list from 2 other drop down lists. I currently have it working from just one of the lists as follows:

If(IsBlank(('ComboBox1'.SelectedItems)) || IsEmpty('ComboBox1'.SelectedItems), SortByColumns(GroupBy(List,"Title","Name"),"Title",SortOrder.Ascending), SortByColumns(GroupBy(Filter(List, 'ComboBox1'.Selected.ListName = 'ListName'),"Title","Name"),"Title",SortOrder.Ascending))

I now need to essentially include the same IF statement again, as an or condition. So If the above or if the same again with ComboBox2. However I am not sure how to do this.

I have tried to do it as first IF || second IF but no luck.

Any help appreciated.

3
  • Can you explain more about your requirements? Do you want to show records from List based on both combo boxes? Or only one combo box conditionally like - If ComboBox1 is empty, show records based on ComboBox2 else show records based on ComboBox1. If both are empty, show all records from List? Jun 15, 2023 at 9:06
  • I am looking to show all list items if both combo boxes are empty/blank, however if combobox1 is used I need the list to filter and sort by that selection, but if combobox2 is used I need it to filter by that selection. It is not likely for both combobox1 and 2 to be used together as they will be used by different sets of users.
    – PA_Novice
    Jun 15, 2023 at 9:13
  • check below answer. let me know if it works for you. Jun 15, 2023 at 9:50

1 Answer 1

0

Based on my understanding from your question and comment(s) above, try using formula like given below:

If(
    IsBlank('ComboBox1'.SelectedItems) || IsEmpty('ComboBox1'.SelectedItems),
    If(
        IsBlank('ComboBox2'.SelectedItems) || IsEmpty('ComboBox2'.SelectedItems),
        SortByColumns(
            GroupBy(List, "Title", "Name"),
            "Title",
            SortOrder.Ascending
        ),
        SortByColumns(
            GroupBy(Filter(List, 'ComboBox2'.Selected.ListName = 'ListName'), "Title", "Name"),
            "Title",
            SortOrder.Ascending
        )
    ),
    SortByColumns(
        GroupBy(Filter(List, 'ComboBox1'.Selected.ListName = 'ListName'), "Title", "Name"),
        "Title",
        SortOrder.Ascending
    )
)
1
  • 1
    Perfect , Thank you that seems to have done the trick.
    – PA_Novice
    Jun 15, 2023 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.