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 User().email fr...
Power Apps
Answered

Filter User().email from Sharepoint

(0) ShareShare
ReportReport
Posted on by 428

I have gallery which using below formula to filter from Master , now i have another list Name user matrix where i have entries like below :

Title    Admin (Single line Text column )
Test1   Ashok.kumar@XXX.com;"AShok.Kumar2@XXX.com;AShokkumar3@XXX.com 
Test2   kumar@XXX.com;"Kumar2@XXX.com;kumar3@XXX.com 

Now how can I  add additional filter in below formula so current user belongs to Test1 Admin it will show the items in gallery else not

If(
 showAll = "All",
 Sort(Filter (Master, ((IntermediateStatus.Value="Submitted" && AttorneyFor.Value="Approved by Manager")||IntermediateStatus.Value="Approved by Supervisor"||IntermediateStatus.Value="Approved by VP")),ID,Descending),
 showReport = "Report",
Sort( Filter(
 Master,((IntermediateStatus.Value="Submitted" && AttorneyFor.Value="Approved by Manager")||IntermediateStatus.Value="Approved by Supervisor"||IntermediateStatus.Value="Approved by VP") ,
 If(
 IsBlank(Dropdown1_4.Selected.Result),
 true,
 InitatorName.DisplayName = Dropdown1_4.Selected.Result
 ) 
 && If(
 IsBlank(Dropdown1_5.Selected.Result),
 true,
 Group.Value = Dropdown1_5.Selected.Result
 ) 
 ),ID,Descending)
)
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    Hi @Ashok2 ,

    Firstly I have free-typed this with no way of testing, so watch commas, brackets etc, but look at the structure and syntax as I believe you need to do something like this. I have also tried to keep it Delegable - so firstly at App OnStart do this

    Set(gblUser,User())

    then your code

    With(
     {
     wList:
     Sort(
     Filter(
     Master, 
     (
     IntermediateStatus.Value="Submitted" && 
     AttorneyFor.Value="Approved by Manager"
     ) ||
     IntermediateStatus.Value="Approved by Supervisor" ||
     IntermediateStatus.Value="Approved by VP"
     ),
     ID,
     Descending
     ),
     IsAdmin:
     With(
     {wAdmin:Admin},
     !IsBlank(
     LookUp(
     wAdmin,
     gblUser.Email in Test1
     ).Test1
     )
     )
     },
     Filter(
     wList,
     (showAll = "All" || isAdmin) ||
     If( 
     showReport = "Report",
     (
     IsBlank(Dropdown1_4.Selected.Result) || 
     InitatorName.DisplayName = Dropdown1_4.Selected.Result
     ),
     (
     IsBlank(Dropdown1_5.Selected.Result) || 
     Group.Value = Dropdown1_5.Selected.Result
     )
     )
     )
    )

     

    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.

  • Ashok2 Profile Picture
    428 on at

    @WarrenBelz 

    Thanks you for code but can you help me understand below syntax with respect o my Sharepoint list "User Matrix" which column refer and where the list name is defined ?

    Title    Admin (Single line Text column )
    Test1   Ashok.kumar@XXX.com;"AShok.Kumar2@XXX.com;AShokkumar3@XXX.com 
    Test2   kumar@XXX.com;"Kumar2@XXX.com;kumar3@XXX.com 


    IsAdmin:
    With(
    {wAdmin:Admin},
    !IsBlank(
    LookUp(
    wAdmin,
    gblUser.Email in Test1
    ).Test1
    )
    )
    }




  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    Hi @Ashok2 ,

    It is looking for a matching record in your Admin Table where the user's email is in the field Test1. If a record exists, it will return true, otherwise false. You will see further down I have referred to it so if either it is true, or "show all" selected, all records will display.

    A With() statement is nothing more than a (very) temporary Variable that is available later in the code.

     

    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.

  • Ashok2 Profile Picture
    428 on at

    @WarrenBelz 
    i am trying but getting error in Test1 field unbale to find 

  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    @Ashok2 ,

    You did not tell me the name of your list and I used Admin - you will need to change this to the list name if it is not correct.

  • Ashok2 Profile Picture
    428 on at

    @WarrenBelz 

    I got this and replace with my list name but still not working not sure why may be i missing something but I will find it out Thanks for your help

  • WarrenBelz Profile Picture
    156,732 Most Valuable Professional on at

    @Ashok2 ,

    Going back to the basics -

    Firstly directly set the mail at App OnStart

    Set(gblUserMail,User().Email)

    then if you put this on a Label, what do you get?

    LookUp(
     YourListName,
     gblUserMail in Test1
    ).Test1

     

    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.

  • Ashok2 Profile Picture
    428 on at

    @WarrenBelz 

    Below screenshot of my Admin list where group is multiselect people picker column from where i need to check current user before i am using single line text column but now i am using people picker multiselect 

    Ashok2_0-1619156647093.png

     




  • Ashok2 Profile Picture
    428 on at

    @WarrenBelz 

    Your solution worked ! i made few modification

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