cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hardy299
Helper III
Helper III

Filter a lookup type field on power apps

Hi team,

I'm asking for your help with a problem I've been having since Friday; actually i want to filter a search type field in a form using a "drop down list".
The screenshot above represents my form so the data source is a share point list
the fields I want to filter these Item fields (Type Lookup)
very close to my form so I create a "drop down" which lists all the categories of articles
I therefore want to display the articles in the search field of my form according to the category selected in the drop-down list Thank you for your help!

Hardy299_0-1629716891868.png

 

14 REPLIES 14
Bilakanti
Impactful Individual
Impactful Individual

@Hardy299  Is Article a lookup field? And you want to filter Articles with which article is been selected in the dropdown right?

 

WarrenBelz
Super User
Super User

Hi @Hardy299 ,

It is helpful to post some field, list and control names, but a Lookup column needs some further "treatment" to filter on (incidentally they are completely unnecessary in Power Apps and will only cause you unwanted difficulties on many levels. The syntax would be

Filter(
   AddColumns(
       ListName,
       "WhateverName",
       LookupField.Value
   ),
   WhateverName = YourDropdown.Selected.xxxx
)

where xxxx is the valid output of the dropdown(Value/Result/FieldName). Note that this is not Delegable - it will only work on list numbers up to your (500-2,000) Delegation limit.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@Bilakanti ,

Yes the article is a lookup field and I want to filter them according to the Category selected in the Dropdown in capture.
NB the data source of the dropdown is a list Sp 

Hardy299_0-1629717485642.png

 

Bilakanti
Impactful Individual
Impactful Individual

@Hardy299 I would agree with @WarrenBelz  statement.

Thank you @WarrenBelz && @Bilakanti 

I tried the request but it doesn't work on my end. my article field suddenly became empty, in fact I cannot expand:

the request :

/*Choices([@DemandeAchatArticleFournisseur].ArticleId)*/
/*Filter(Article,CategorieId.Value=Dropdown3.Selected.Nom||IsBlank(Dropdown3.Selected.Nom))*/
Filter(
   AddColumns(
       DemandeAchatArticleFournisseur,
       "WhateverName",
       ArticleId.Value
   ),
   WhateverName = Dropdown3.Selected.Nom
)

 

"DemandeAchatArticleFournisseur" Here is my list (Source date of the form)

@WarrenBelz 

Categories also come from the Sp list (Lookup Fields in the Item list)

Hi @Hardy299 ,

How many items are in your list?

 

@WarrenBelz  just 11 Articles

@Hardy299 ,

OK you do not have a Delegation issue, but if ArticleID is a Lookup column and you want to filter on its value selected being in Dropdown3 (assuming the output is nom), then the code

Filter(
   AddColumns(
       DemandeAchatArticleFournisseur,
       "WhateverName",
       ArticleId.Value
   ),
   WhateverName = Dropdown3.Selected.Nom
)

 is correct (and I only used WhateverName suggesting you could put anything there).

Is there something incorrect in the assumptions?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (2,785)