cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Taylope1
Helper II
Helper II

Filter using Contains

Hi ,

 

So here is my items filter line.

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

 

Works fine.   Now I want to add something like If(Office365Users.MyProfile().UserPrincipalName contains "XYZ" to the beginning so if my domain (which is contained in UserPricipalName) has XYZ in it the filter above will be applied.

 

Driving me mad!!

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

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

 

Or

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

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.

View solution in original post

1 REPLY 1
eka24
Super User
Super User

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

 

Or

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

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.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,731)