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 / help with functions
Power Apps
Unanswered

help with functions

(0) ShareShare
ReportReport
Posted on by 1,625

Hi,

I'm struggling with some fucntions, if someone can help please.

 

1- On my App OnStart I have set Set(VarUser, User());

When I try to use this on my Gallery, Items property it wont find any records:

Filter('ListName', 'Created By'.Email = VarUser.Email)
But if I use the following this filters the items in the gallery:

Filter('ListName', 'Created By'.Email = User().Email)

I'm trying to avoid the delegation warning by setting the user as a variable but not getting any results.

 

2- I have another screen with a second Gallery and Edit form and I'd like the filtering to be based on 2 values in 2 fields which are SPO Person fields, i.e. User2 and User3 are both people fields and I'd like any items to display in the gallery if the logged in users name is in either of the 2 fields, I've tried the follwing but again the it doesnt work:

Filter('ListName', DataCardValue27_1.Selected.Email || DatacardCardValue28_1.Selected.Email)

 

Cant get both to work is someone able to assist please?

Categories:
I have the same question (0)
  • kriggo15 Profile Picture
    526 on at

    For #1 try:

    Set(VarUser, User().Email)

    Filter (ListName, 'Created By'.Email = VarUser)

     

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Lefty 

    For #2:

     

    I'm a little unclear about what you are trying to do.  This code would filter on both emails found in the dropdown.

    Filter(
     'ListName',
     CreatedBy.Email = DataCardValue27_1.Selected.Email
     || CreatedBy.Email = DatacardCardValue28_1.Selected.Email
    )

     

    Note: you can mark more than 1 solution if both Kriggo and I solved your problem.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    HI

     

    When I use this, I dont get any items displayed in my gallery, removing the variable and setting it back to user().Email brings back the items in the gallery.... cant put my finger on what it doesnt like.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    HI @mdevaney ,

    This doesn’t work either:
    Filter('ListName', 'Created By'.Email = DataCardValue27_1.Selected.Email)
    It accepts the function without any errors, but doesn’t show any records.
    What I'm trying to achieve is, if the form has the name of the logged in user in DataCardValue27_1 or DataCardValue28_1 it will only display those items in the gallery.
    I have a form, which user1 submits to user2/user3 and I want to lock down only those items where a user is specifically listed in either of the above boxes to only display those items and not display all the items from the SPO list. So I leave the gallery items property set to ‘ListName’ everything any user has submitted will be visible, and I’d like the above filter to work, but can’t.

  • timl Profile Picture
    36,785 Super User 2026 Season 1 on at

    For #1...

    To diagnose this, I'd add a label and set the Text property to varUser.Email. Does the label show your email address? If not, a common reason for this type of problem is that during design time, we need to click the 'Run OnStart' item to execute our OnStart code.

     

    image.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    HI @timl 

    Thanks for your response, The label would pick up my email add... but strangely this morning this is now working and VarUser variable is correctly displaying the items, even though the same function wouldn't work yesterday... very strange.

    In regards to #2 I can't get it it work but maybe I can avoid using a gallery on that screen anyways so will not spend more time trying to get it to work.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard