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 formulate a fil...
Power Apps
Answered

How to formulate a filter?

(0) ShareShare
ReportReport
Posted on by 16

Hi I'm new to Power Apps

 

If have following filter in my Power App working
SortByColumns(Filter([@Budget]; StartsWith(Title; TextSearchBox1.Text)); "Date"; If(SortDescending1; Descending; Ascending))
"Budget" is the connection to a SharePoint list.

 

filter.png

The list contains items from different users, the items contain items with Employee column.

in a detail view I get data from "Employee.Claims"
the result is "i:0#.f|membership|",volker.mxxxxx@company.com"

This is the only information I got.

 

Question: How to formulate the filter that it is only shows data for the actual user?

SortByColumns(Filter([@Budget];....

 

Thanks in ahead

Volker

 

Categories:
  • eka24 Profile Picture
    20,925 on at

    Which is the employee name? volker.mxxxxx or volker

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

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • VolkerM Profile Picture
    16 on at

    the user email is like "volker.mxxxxx@company.com"

  • eka24 Profile Picture
    20,925 on at

    This formula:

    Right(Substitute(TextSearchBox.Text, "|", Char(9), 2),
    Len(TextSearchBox.Text)-Find(Char(9), Substitute (TextSearchBox.Text, "|", Char(9), 2), 1) + 1)
     
    Produces:
    Character.JPG
     
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @VolkerM ,

     

    Do you mean you want to filter the gallery to display the item of current user?

    Please try this:

    SortByColumns(Filter([@Budget]; StartsWith(Title; TextSearchBox1.Text); Employee.Email=User().Email); "Date"; If(SortDescending1; Descending; Ascending))

     

    The better way is save the User().Email to a variable in App.OnStart property, and apply the variable into above code.

    App.OnStart: Set(VarEmail, User().Email)

    SortByColumns(Filter([@Budget]; StartsWith(Title; TextSearchBox1.Text); Employee.Email=VarEmail); "Date"; If(SortDescending1; Descending; Ascending))

    Hope this helps.

    Sik

  • Verified answer
    VolkerM Profile Picture
    16 on at

    Hi @v-siky-msft 

     

    I found a similar solution this morning. 

     

    SortByColumns(Filter([@Budget];
              Employee.Email = MyProfile.Mail

              && If(IsBlank(TextSearchBox1.Text);true;TextSearchBox1.Text in Product));
              "Date";If(SortDescending1;Descending;Ascending)
    )

     

    Inside initial Screen OnVisible

    Set(MyProfile;'Office365-Benutzer'.MyProfile())

    Question: Is it better to do this inside App OnStart ?

     

    thank you anyway

    Volker

     

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @VolkerM ,

     

    Yes, both methods work.

    I suggest put the code to App.OnStart, since there is no need to trigger it every time the screen appears.

    Sik

  • eka24 Profile Picture
    20,925 on at

    If it resolved, mark the answer so other users to benefit

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

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard