cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lym
Frequent Visitor

Filter items in Combobox

In SharePoint online, I have a “Purchase Order” list and it has “Foreign PO” yes/no column.

Lym_7-1593741546224.png

 

Lym_2-1593741516898.png

 

 

In PowerApps, I have a combo box that currently display all Purchase Orders. Now I want to display only the Purchase Orders where Foreign PO = Yes.

 

I have tried updating the “Item” property to the below but it says invalid argument type.

Lym_3-1593741516901.png

 

 

I also tried changing it to below but it displays the item where purchase order is false. Also tried changing it to ‘Foreign PO’ = false but the result is the same.

Lym_4-1593741516902.png

 

 

My combo box

Lym_5-1593741516903.png

 

 

It’s displaying the record where Foreign PO = No. It should display the other record and not display this record.

Lym_6-1593741516904.png

 

 

Any help is appreciated. Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
SimonPiquer
Continued Contributor
Continued Contributor

Hi,


I believe there is a known bug for Yes/No fields, see: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Properly-filter-SharePoint-Yes-No-column/idi-p/...

 

As stated in that thread, you can exchange true/false in your filter for 1/0, so your filter could be:

 

Filter('Purchase Orders', 'Foreign PO' = 1)

 

 

The linked thread is quite long and there seem to be a bunch of different issues, I suggest you read through it if you need further assistance!

View solution in original post

4 REPLIES 4
SimonPiquer
Continued Contributor
Continued Contributor

Hi,


I believe there is a known bug for Yes/No fields, see: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Properly-filter-SharePoint-Yes-No-column/idi-p/...

 

As stated in that thread, you can exchange true/false in your filter for 1/0, so your filter could be:

 

Filter('Purchase Orders', 'Foreign PO' = 1)

 

 

The linked thread is quite long and there seem to be a bunch of different issues, I suggest you read through it if you need further assistance!

v-yutliu-msft
Community Support
Community Support

Hi @Lym ,

Do you want to filter based on yesorno field of sharepoint list?
Firstly, let me analyze your first formula.

Filter('Purchase Orders', 'Purchase Orders'.'Foreign PO' = true)

"'Purchase Orders'.'Foreign PO' " represents a table. You can not compare a value with a table.

You should compare a value with a field.

So you should use formula like this to filter based on 'Foreign PO'  field.

Filter('Purchase Orders', 'Foreign PO' = value)

 

 

Secondly, let us analyze your second formula.

I agree with @SimonPiquer .

Yes, it is an already know issue about yesorfield: You could not compare it with true or false.

For now, it's not supported to compare it with 1/0.

1 represent yes in yesorno field.

0 represent no in yesorno field.

So in your issue, you should use this formula to get the items that 'Foreign PO' value is yes:

Filter('Purchase Orders', 'Foreign PO' = 1)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @SimonPiquer  @v-yutliu-msft thank you both for the response. Yes it worked when I changed it from true/false to 1/0.

Additional question, why is the combo box search functionality not working when filter is added to items?
My combo box setMultiple is set to false but I would like for the user to be able to use the search functionality also. When I tried to enabled it, nothing is displayed.

When isSearchable is false:

Lym_0-1593759012729.png


When its true:

Lym_1-1593759026004.png

 


Thanks in advance.

v-yutliu-msft
Community Support
Community Support

Hi @Lym ,

Please check whether you choose right primary text for this combo box.

What's more, combo box will not reset automatically every time you make any change on it.

So I suggest you delete the original combo box, reinsert one and set it.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,964)