sabukaru
sabukaru

Reputation: 25

Filtering Dataverse Choice Column by Combo Box Whose Items are the same Choices Object

Seems like a simple solution but it is so nuanced Google searches are failing me.

I have a Dataverse table with a choice column. In Power Apps, I have a combo box whose items property is set to the choice options object from the choice column. When I change the combo box, I want the gallery that shows the table's records to filter by the selection from the combo box.

The code below does not filter correctly, but no error is given as to why. The gallery displays empty even tho a selection has been made in the combo:

Filter(
        'CSP Product Orders', 
        'Bill To Number' = BillToCombo.Selected.bill_to_no && 
        'Ship To Number' = ShipToCombo.Selected.ship_to_no && 
        'Order Status' = OrderViewSelectCombo.Selected.Value
    ),

With the code below, the filter displays correctly:

Filter(
        'CSP Product Orders', 
        'Bill To Number' = BillToCombo.Selected.bill_to_no && 
        'Ship To Number' = ShipToCombo.Selected.ship_to_no && 
        'Order Status' = 'CSP Product Order Status'.New
    ),

However, this does not work because 'CSP Product Order Status'.New is of course a static value. I need the filter value to come from the combo box selection.

Any thoughts? Thanks in advance.

Upvotes: 0

Views: 1330

Answers (1)

sabukaru
sabukaru

Reputation: 25

One solution:

Update context variable On Change property of the combo box that stores Self.Selected.Value and then use the variable in the argument for the filter.

However, I have no idea why this works and the simple reference ComboBox1.Selected.Value does not work. Is not Self.Selected.Value = ComboBox1.Selected.Value?

Upvotes: 0

Related Questions