web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Filter lookup f...
Power Apps
Answered

How to Filter lookup field CDS

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I think this is not that difficult but I am having trouble filtering my gallery.

 

My data all is CDS.

I would like to filter my gallery like the following.

 

I’ve tried this but not working.

Filter(tabelname, TextSearchBox1.Text in  fieldname(lookup).'name')
Filter(tabelname, TextSearchBox1.Text in  table_b.'name')
 
'name' is a field in Related table(tabelname: table_b)
 
Any help is appreciated!

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Anonymous ,

     

    Try doing something like

    Filter(tabelname,IsMatch(fieldname(lookup).'name',TextSearchBox1.Text))
     
    Regards,

    ------------------------------------------------------------------------------

    If this helped you, please consider giving it kudos and accept it as a solution. Thanks 

     
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Anonymous 

     

    thank you for your help!

    I am still having errors. 

    Would you please check this?

    I've tried two way.

     

    mssss_1-1608891423994.png

     

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Actually my bad, Please forgive me.

    You can't filter a field from a related table, what you need to do and to minimize the lookup calls is :

    1. Collect your table1 in a collection like so (ClearCollect, varTable1, table1);
    2. Collect table2 (related table) : ClearClollect(varTable2,table2);
    3. ClearCollect(varFinalTable,AddColumns(varTable1,"Name", LookUp(varTable2,name = varTable1[@fieldname(lookup)]).Name));
    4. For  the gallery Items you use (Filter(varFinalTable,IsMatch(Name,TextSearchBox1.Text))

    You need to understand delegation, and work your way to update your rows or create elements in database (using Patch etc ).

     

    Regards,

    ------------------------------------------------------------------------------

    If this helped you, please consider giving it kudos and accept it as a solution. Thanks 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 462

#2
WarrenBelz Profile Picture

WarrenBelz 425 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 291

Last 30 days Overall leaderboard