cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dorinda
Super User
Super User

Filter Lookup

I have this formula and it works great except I need to to filter for the year 2022

If(IsEmpty(ComboBox2.Selected.Title), 
    Blank(), 
    LookUp(ChairSurvey_1, 'Meeting Group'= ComboBox2.Selected.MeetingName , ChairPerson.DisplayName )
)

 I tried to add && 'Service Year'=2022 but that didnt work and I am not sure how to get this to work.

1 ACCEPTED SOLUTION

Accepted Solutions

I did it a different way and it is working now.

 

I changed the lookup list it was easier

If(IsEmpty(ComboBox2.Selected.Title), 
    Blank(), 
    LookUp(SafetyMeetingGroups_1, MeetingName = ComboBox2.Selected.MeetingName, Chairperson.DisplayName) 
)

View solution in original post

11 REPLIES 11
fatjosh35
Helper I
Helper I

Did you try adding ".Value" after service year:

 

&& 'Service Year'.Value = 2022

 

What data type is the Service Year field?

Yes and it gave me "False" as the return value not a name I was expecting.

Is service year a date field? a text field? or a number field?

Text

Try wrapping 2022 in double quotes then. 

 

&& 'Service Year' = "2022"

 

Otherwise it would give you that false value since it's trying to compare a string (or text) to a number, which doesnt work.

Yeah tried that and still got the false

If(IsEmpty(ComboBox2.Selected.Title), 
    Blank(), 
    LookUp(ChairSurvey_1, 'Meeting Group'= ComboBox2.Selected.MeetingName , ChairPerson.DisplayName && 'Service Year' = "2022"
))

Try moving it into the second parameter of the LookUp() function. That's where the filter logic goes.

If(IsEmpty(ComboBox2.Selected.Title), 
    Blank(), 
    LookUp(ChairSurvey_1, 'Meeting Group'= ComboBox2.Selected.MeetingName && 'Service Year' = "2022", ChairPerson.DisplayName
))

Now I just get a "Blank" as the response.

Is ComboBox2 empty?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,876)