web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter using Email add...
Power Apps
Unanswered

Filter using Email address

(0) ShareShare
ReportReport
Posted on by 78

Hi! I'm trying to filter my dataset based on the user email address. So I'm adding the below line into the OnStart method of my screen.

 

Filter(FlotaTest_1; FlotaTest_1.EMail = User().Email)

 

FlotaTest_1 is my DataSource name which brings data from SharePOint online and FlotaTest_1.EMail is the field on where I do have user eMail address.

 

I'm not getting what I'm doing wrong here. The error message in the above formula sayd that the number of Arguments are not valid.

 

Ideas will be apreciates!

 

Regards,

 

Diego!

Categories:
I have the same question (0)
  • Verified answer
    Meneghino Profile Picture
    6,949 on at
    Re: Filter using Email address

    Hi @diegoadum

    The OnStart property is normally for actions, not table valued results.  The formula you supply should return a table.

    Also, you do not need to repeat the table name.

    Finally: https://baizini-it.com/blog/index.php/2017/08/29/powerapps-user-function-cache-current-user-onstart/

     

    Happy to give more guidance

     

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at
    Re: Filter using Email address

    The code should go into the Items property of the gallery. That code by itself won't do anything in the OnStart and the semi colon should be a comma (unless the language setting is like German where commas are semi colons).

     

    Filter(FlotaTest_1, FlotaTest_1.EMail = User().Email)
  • diegoadum Profile Picture
    78 on at
    Re: Filter using Email address

    Hi Meneghino,

     

    I changed the place of the formula and now it's located into the Gallery (Items), but the result is the same. IN fact I do create a variable using Set(CurrentUser, User()) in the OnStart method of the screen and nothing. As a test I place a label and set the Text property as CurrentUser.Email and the result is blank.

     

    Any idea?

  • Meneghino Profile Picture
    6,949 on at
    Re: Filter using Email address
    Yes, you need to save and close the app and reopen it for the Start method to fire. It will fire once only.
  • Meneghino Profile Picture
    6,949 on at
    Re: Filter using Email address
    OnStart, not Start. Apologies but am now on mobile and the interface for the community is even worse than on the deaktop. Can’t seem to be able to edit posts.
  • Lexnnn Profile Picture
    94 on at
    Re: Filter using Email address

    This did help me to filter on User = email from people field: (I was using people field and it did not work well with powerapps) (3200+ items)
    https://wonderlaura.com/2018/10/26/powerapps-filter-by-me/

    Solution in short: use variable "on start" + "OnVisisble" refresh of the list and use same variable in filter +  single line of text field instead of poeple field.

    SortByColumns(Filter('Sandwich shop',(Salesrepemail = CurrentUser.Email) And ((StartsWith(Account_x0020_name, TextSearchBox1.Text)) Or (StartsWith(Street, TextSearchBox1.Text)) Or (StartsWith(City, TextSearchBox1.Text))Or (StartsWith(Postal_x0020_Code, TextSearchBox1.Text)))), "Account_x0020_name", If(SortDescending1, Descending, Ascending))

     

    To let the users still be able to use the people field, I use flow to auto populate the new single line of text field with a copy of email adress from people field.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard