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 / Filter using contains
Power Apps
Unanswered

Filter using contains

(0) ShareShare
ReportReport
Posted on by 60

So here is my current items line.

SortByColumns(Filter([@'SAM Catalogue'], 'BU Approved'.Value="RRR", TextSearchBox1.Text in Description||TextSearchBox1.Text in Application),"Title", If(SortDescending1, Descending, Ascending))

 

I want to add something like this so the above only filters is the UserPrincipal name contains XYZ.

If(Office365Users.MyProfile().UserPrincipalName contains "XYZ"

 

Thx

Categories:
  • SimonPiquer Profile Picture
    255 on at

    Hi,

     

    I believe what you are looking for is the  IsMatch function. So something along the lines of the following should do the trick:

     

    SortByColumns(Filter([@'SAM Catalogue'], IsMatch(Office365Users.MyProfile().UserPrincipalName,"XYZ",MatchOptions.Contains), 'BU Approved'.Value="RRR", TextSearchBox1.Text in Description||TextSearchBox1.Text in Application),"Title", If(SortDescending1, Descending, Ascending))

     

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Taylope1 

    What relationship does UserPrincipalName have to your datasource.  Where can we find it?  What column?

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • Taylope1 Profile Picture
    60 on at

    @mdevaney 

     

    UserPrincipalName is effectively looking at the current user.

     

    If they in domain XXX i want to filter the list using filter A.  If their domain is not containing XXX then use another filter on the items.

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Taylope1 
    Right.  But what I am asking is: where is that information stored in your datasource?  What column?  If UserPrinicpleName is not found there you cannot filter by it.  I could be wrong on this, but I checked and SharePoint does not store UserPrincipalName in a People column. 

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard