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 Apps
Answered

Gallery Filter

(0) ShareShare
ReportReport
Posted on by 308

Hi 

 

I've a textbox and wanna filter a gallery with it.

My formula:

 

With({Controle:ControleDespesas; Enderecos: ENDERECOS};
Sort(
Filter(Controle;
Ano = Text(AnoEscolhido);
Despesa = DespesaEscolhida;
txtbusca.Text = Blank() Or RefIDEnd = LookUp(Enderecos;txtbusca.Text in Cidade).Idend || LookUp(Enderecos;txtbusca.Text in Endereco).Idend

);RefIDEnd;Ascending)
)

 

 

My screen:

 

alessandramaced_0-1639073791129.png

 

The textbox (txtbusca) and filter is not working for "Cidade" and "Endereco".

What I did wrong?

I've to filter "ControleDespesas" and textbox need to search in another sharepoint list named "ENDERECOS". The field of "IDEnd" from "ENDERECOS" is number and make reference to field "RefIDEnd" from "ControleDespesas".

In gallery the fields Cidade" and "Endereço" are lookup datas :

Endereço: LookUp(ENDERECOS;Idend=ThisItem.RefIDEnd).Endereco

Cidade: LookUp(ENDERECOS;Idend=ThisItem.RefIDEnd).Cidade

 

My sharepoint lists are as bellow:

ENDERECOS:

alessandramaced_1-1639074132882.png

 

 

ControleDepesas:

alessandramaced_2-1639074161727.png

 

 

RefIDEnd = IDEnd

 

Thanks in advance

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,411 Most Valuable Professional on at

    Hi @alessandramaced ,

    Try the below - you need to refer to the field value in each LookUp and also bracket your and/or areas

    With(
     {
     Controle:ControleDespesas; 
     Enderecos: ENDERECOS
     };
     Sort(
     Filter(
     Controle;
     Ano = Text(AnoEscolhido) &&
     Despesa = DespesaEscolhida &&
     (
     txtbusca.Text = Blank() ||
     RefIDEnd = LookUp(
     Enderecos;
     txtbusca.Text in Cidade
     ).Idend || 
     RefIDEnd = LookUp(
     Enderecos;
     txtbusca.Text in Endereco
     ).Idend
     )
     );
     RefIDEnd
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • alessandramaced Profile Picture
    308 on at

    not working, know shows nothing in gallery

     

    I think the problem is that I can't use lookup, because can exist more than one record with same "Cidade" or part of Address ("Endereco").

    Is that possible to filter gallery like this?

  • WarrenBelz Profile Picture
    154,411 Most Valuable Professional on at

    @alessandramaced ,

    That does not really help me - unless I can understand what it is you are trying to do, I can only rely on the code you posted and try to make it valid syntax  I assume the code is not producing errors?

  • Verified answer
    alessandramaced Profile Picture
    308 on at

    I got it.

    Delete textsearchbox , put a dropbox instead wtih all "Endereco" (address).

    And change gallery filter formulta to:

    With(
    {Controle:ControleDespesas; Enderecos: ENDERECOS};
    Sort(
    Filter(Controle;
    Ano = Text(AnoEscolhido);
    Despesa = DespesaEscolhida;
    dpdFiltroEnd.Selected.Endereco = Blank() Or RefIDEnd = LookUp(Enderecos;Endereco = dpdFiltroEnd.Selected.Endereco).Idend
    );
    RefIDEnd;Ascending)
    )

     

     

    Now it's working.

    Thank you

     

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard