cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mpezzutti
Level: Powered On

Filter Function not working

Hello Everyone

I have a big problem when filtering a table. Especially when Im using the "IN" operator.

 

I have a combobox which I can select multiple items and I created a field called Txtformid_1. I use the concat function to string the selected items together. This works fine. Its when I use the Filter to lookup records that my Filter does not want to work.

 

 

Below is my code

 

If(

                    !IsBlank(txtFullname.Text) And !IsBlank(Txtformid_1.Text) And IsBlank(Txt_Project.Text) And IsBlank(Txt_State.Text),/* Condition 4 */

                    SortByColumns(

                        Filter(

                            '[frm].[_0ResultsReview]',

                            (FullName = tmpname) And (FormName in Txtformid_1.Text) And (ObservationDate >= Value(

                                Text(

                                    tmpstartdate,

                                    "[$-en-US]yyyymmddhhmm"

                                )

                            ) And ObservationDate < Value(

                                Text(

                                    tmpenddate + 1,

                                    "[$-en-US]yyyymmddhhmm"

                                )

                            )

                        )),

                        "ObservationDate",

                        Descending

                    ),

 

Could someone please help me

 

Thank you so much

 

 

 

 

1 REPLY 1
Dual Super User
Dual Super User

Re: Filter Function not working

Hi @mpezzutti 

 

You can directly use the combobox selected Items with the "IN" operator.

Can you try to update the expression to:

If(!IsBlank(txtFullname.Text) && !IsBlank(Txtformid_1.Text) && IsBlank(Txt_Project.Text) && IsBlank(Txt_State.Text),
SortByColumns(
Filter(
'[frm].[_0ResultsReview]',
FullName = tmpname && FormName in Combobox1.SelectedItems.Value && ObservationDate >= Value(Text(tmpstartdate, "[$-en-US]yyyymmddhhmm") && ObservationDate < Value(Text(tmpenddate + 1,"[$-en-US]yyyymmddhhmm")) )),
"ObservationDate",
Descending
),
...)

Here, Combobox1.SelectedItems.Value needs to be replaced with the actual combobox name and the column you want to fetch out of it.

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,513)