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

Filter - Driving me crazy

Hi All, been stuck on this for two days and it is driving me crazy 😉

 

Trying to filter results of a gallery (users gallery) by the selected item of a previous Gallery (ExpoGallery). 

 

ExpoNameLookup is a lookup field in Table "ExposPeople"

 

UsersGallery = SortByColumns(Filter(ExposPeople, ExpoNameLookup.Value = ExpoGallery.Selected && StartsWith(Name, UserSearchBox.Text)), "Name", If(SortDescending2, Descending, Ascending))

I'm being told that the " = " is an invalid argument type, and yet " = " is supported by Lookup fields....

 

Any help would be GREATLY appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
NEPatton Kudo Kingpin
Kudo Kingpin

Re: Filter - Driving me crazy

Oh...what about ExpoGallery.Selected?  This is probably a record, right?  You can't use "=" with a record -- so this is probably the error.

 

You need to specify the field for the selected item in ExpoGallery.

ExpoGallery.Selected.FieldName

View solution in original post

6 REPLIES 6
NEPatton Kudo Kingpin
Kudo Kingpin

Re: Filter - Driving me crazy

Not sure...one thing to try might be to segregate your condition a bit by adding ().

 

Try...

 

(ExpoNameLookup.Value = ExpoGallery.Selected) && ...

 

With regards to...

StartsWith(Name, UserSearchBox.Text)

 

Is Name a field in ExposPeople?  If not, then this is also probably an issue.

Plainace
Frequent Visitor

Re: Filter - Driving me crazy

Unfortunately, that didn't work. I have attached some screenshots: Screen.PNG

 

Also, yes Name is a field within ExposPeople.

I Know I'm close... I just can't get it done.

 

The blue (i) states - This can't be evaluated remotely due to service limitations .... But this is usually just a warning.

NEPatton Kudo Kingpin
Kudo Kingpin

Re: Filter - Driving me crazy

Oh...what about ExpoGallery.Selected?  This is probably a record, right?  You can't use "=" with a record -- so this is probably the error.

 

You need to specify the field for the selected item in ExpoGallery.

ExpoGallery.Selected.FieldName

View solution in original post

Highlighted
SmartMeter Helper V
Helper V

Re: Filter - Driving me crazy

NEPatton is 1000% correct. I am doing the same thing in one of my apps (responsive second gallery) and this code works. 

 

SortByColumns(Filter(Fini**bleep**, Completed = "false", TextIssue = BrowseGallery1.Selected.Title ), "Created", If(SortDescending1, Ascending, Descending))

Plainace
Frequent Visitor

Re: Filter - Driving me crazy

ooooh **bleep**. I think we are onto a winner. I had no idea you could not use = with a record.... It's somewhat confusing that it comes up as a suggestion.......

 

Thanks so much for your help. You have saved me heaps and heaps of further head scratching....

NEPatton Kudo Kingpin
Kudo Kingpin

Re: Filter - Driving me crazy

Anytime 🙂  Glad I could help.

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,655)