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

Filter gallery using lookup field

I've seen several articles regarding this and am not able to come up with a solution.

 

I have a gallery where I want to filter on a lookup field:

 

Filter(Projects,Or(IsBlank(SearchProjectInput.Text),SearchProjectInput.Text = ProjectType_New))

 

= is an invalid operator for this formula so I tried:

 

Filter(Projects,Or(IsBlank(SearchProjectInput.Text),SearchProjectInput.Text in (ProjectType_New)))

 

This results in an actual error (not a warning) that the "local evaluation would produce sub-optimal results" and the filter function fails.

 

Please help and thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
mr-dang
Level 10

Re: Filter gallery using lookup field

2 REPLIES 2
mr-dang
Level 10

Re: Filter gallery using lookup field

Filter(Projects,
    Or(
        IsBlank(SearchProjectInput.Text),
        SearchProjectInput.Text = ProjectType_New
    )
)

If SearchProjectInput.Text isn't able to use the = operator with ProjectType_New, then it is likely that the data types are not the same. I'd check to be sure both are Text--maybe one of them is an entire record or something.

 

The "local evaluation would produce sub-optimal results" message or "blue dot" means that PA will try the formula, but it won't return more than 500 records because it is too complicated for it to be delegated by the datasource itself.

Microsoft Employee
@8bitclassroom
mr-dang
Level 10

Re: Filter gallery using lookup field

Helpful resources

Announcements
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 Kudoed Authors (Last 30 Days)
Users online (3,976)