comboboxgallerypowerappstextinputpowerapps-formula

Powerapps Filter Gallery by TextInput And/Or TextInput & ComboBox


I am trying to filter a powerapps gallery by either TextInput And/Or TextInput & ComboBox the code below only filters by textinput can anyone help?

Filter(
   WD_Stock_Items_SP_List,
    TextInput1.Text in Item_Description || TextInput1.Text in Item_Description && 
    ComboBox1.Selected.Value)

enter image description here


Solution

  • Try something like:

    With( { f1: Filter(WD_Stock_Items_SP_List, TextInput1.Text in Item_Description ) },
      If(
        CountRows(ComboBox1.SelectedItems) > 0,
        Filter(f1, yourColumnName.Value = First(ComboBox1.SelectedItems).Value),
        f1
      )
    )