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 / WORKING WITH FILTERS
Power Apps
Answered

WORKING WITH FILTERS

(0) ShareShare
ReportReport
Posted on by

I wanna filter a gallery based on a user().Email and if is not, show the only which he created. 

And I try this code:

 

If(User().Email="USER@ADMIN.COM";Despesas;Filter(Despesas;StartsWith(Solicitante;TextInput1.Text) || ID = DropDown1.Selected.ID || 'Status de pagamento'.Value=ComboBox4.Selected.Value;SortByColumns(Despesas;"ID";Descending);'Criado por'.Email = varUser.Email))


My goal is:

 

If is the USER@ADMIN.COM he can filter by name or ID or "status de pagamento", and if is not she only show the items he created. 

Categories:
I have the same question (0)
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Gorilla_8 ,

     

    Change your filter as below:

    If(User().Email="USER@ADMIN.COM",
    Sort(
    Filter(Despesas,
    StartsWith(Solicitante;TextInput1.Text) || ID = DropDown1.Selected.ID || 'Status de pagamento'.Value=ComboBox4.Selected.Value, 'Criado por'.Email = varUser.Email)),SortByColumns(Despesas,ID,Descending))

     

    I hope this resolved your issue if you see any challenge/need further help let me know I am always happy to help.

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Gorilla_8 Profile Picture
    on at

    Hi @KrishnaV , thanks again for the help!

     

    But I got same error, he expects 2-3 parametres, I think I got lost some parentheses..

     

    Take a look: 

     

    If(User().Email="user@admin.com";
    Sort(
    Filter(Despesas;
    StartsWith(Solicitante;TextInput1.Text) || ID = DropDown1.Selected.ID || 'Status de pagamento'.Value=ComboBox4.Selected.Value; 'Criado por'.Email = varUser.Email));SortByColumns(Despesas;ID;Descending))
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Gorilla_8 ,

     

    My bad I have correct my syntax errors, silly me 😞

    If(User().Email="user@admin.com",
    SortByColumns(
    Filter(Despesas;
    StartsWith(Solicitante;TextInput1.Text) || ID = DropDown1.Selected.ID || 'Status de pagamento'.Value=ComboBox4.Selected.Value; 'Criado por'.Email = varUser.Email);ID;Descending))
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Gorilla_8 ,

     

    I just noticed that you like my reply is there anything I am missing to mark that as a solution?

     

    Please let me know so that I can help you better.

  • Gorilla_8 Profile Picture
    on at

    Hi @KrishnaV !, Igot this error: 

     

    I dont know why, i dont worl well with multiple filters.

     

    The 'sort columns' function has invalid arguments


     FILTERERROR.png

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Gorilla_8 ,

     

    Please change the Combobox selection as :

    ComboBox2.Selected.Title
    where my combobox is populating with SampleList.Title



  • Gorilla_8 Profile Picture
    on at

    Hi @KrishnaV !


    Didnt work out

  • Gorilla_8 Profile Picture
    on at

    Hi @KrishnaV !

     

    I have make a filter by all the data, but can you help me to filter by selected user?

    Filter(Despesas;CreatorEmail=varUser.Email||Solicitante = TextInput1.Text||'Status de pagamento'.Value=DropDown1_1.Selected.Result||ID=DropDown1.Selected.ID)

    I have this code, but I wanna the user logged filter by only his created item. 

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Gorilla_8 ,

     

    Filter(Despesas;Creator.Email=varUser.Email||Solicitante = TextInput1.Text||'Status de pagamento'.Value=DropDown1_1.Selected.Result||ID=DropDown1.Selected.ID)// if creator is a people picker column
    
    Filter(Despesas;Created.Email=varUser.Email||Solicitante = TextInput1.Text||'Status de pagamento'.Value=DropDown1_1.Selected.Result||ID=DropDown1.Selected.ID)// this will pull with the default created sharepoint list column


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to help.

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Gorilla_8 Profile Picture
    on at

    I understand, but I created a column "CreatorEmail" on sharepoint to get the email and filter by, the "created" wont workout here.

    So i tried this

     

    If(User().Email="user@admin.com";Despesas;Filter(Despesas;CreatorEmail=varUser.Email||Solicitante = TextInput1.Text||'Status de pagamento'.Value=DropDown1_1.Selected.Result||ID=DropDown1.Selected.ID)


    And dont show the only items I created

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard