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 / Code for Filtering Gal...
Power Apps
Answered

Code for Filtering Gallery By User does not show error but it doesn't show records either.

(0) ShareShare
ReportReport
Posted on by 228

Why is this code not rendering any results when there are records that I have created.

Filter( 'NEST Intake System', 'Created By'.Email=varUser)

 

ShondaT_0-1678321570363.png

 

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @ShondaT ,

     

    The condition in your filter is case sensitive. Can you make sure the casing matches between the value of varUser and what's in your data source?

     

    If this is the issue, you can use the Lower() function to change all capitals to lower cases which will help overcome this limitation.

  • ShondaT Profile Picture
    228 on at

    @BC 

     

    Below is the result of that. Did I apply it incorrectly?

     

    ShondaT_0-1678321080218.png

     

     

  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @ShondaT ,

     

    It seems there's a closing bracket missing.

     

    Also, has anything changed? Before you were comparing 'Created By'.Email with VarUser and in this screenshot it's 'Creator Email' and User().Email .

  • ShondaT Profile Picture
    228 on at

    @BCBuizer 

     

    My bad on that...I did added it and there's the delegation issue but it's still not rendering any results. I've tried both ways and they continue to render no results. I'm just throwing everything at it that I can think of. 

     

    ShondaT_1-1678321147343.png

     

     

    Here's what happens without the change:

    ShondaT_3-1678321241605.png

     

     

     

  • ShondaT Profile Picture
    228 on at

    @BCBuizer  I've revised my response to your response.

  • mmollet Profile Picture
    3,187 on at

    Try:

    Filter('NEST Intake System', 'Created By'.Email=User().Email)

     

    Make sure to not have a ';' after this statement as for some reason when I tested this it threw an error. Very weird that it does so imo. Also Created By and User().Email shouldn't need the to lower function as they are both set by the system and in both cases are grabbed from the same variable from the user. The only way I can see this being an issue is if you recently changed the email from the admin center or something and now they arent the same.

     

    Also check your text inputs in your gallery and see what the error is on each of those. The gallery isnt throwing an error but the controls inside of it are. Makes me think seeing that might be of some help in getting this solved.

     

    Another thing you can do is to highlight just the 'Created By' and see what that variable is holding then highlight the User().Email and see that they match. If so then you can be sure that this string comparison isn't the issue. 

  • ShondaT Profile Picture
    228 on at

    Thanks @mmollet. I tried your code: Filter('NEST Intake System','Created By'.Email=User().Email)

     

    and it's still rendering no results. When I inspect user() it shows me and my email address. Nothing comes up when I select Created By.

     

    ShondaT_0-1678375423652.pngShondaT_1-1678375432654.png

    When I add the Created By field to my form and remove the filter so all records show, my name appears in the field.

     

    I am really at a loss and I have to get this done today. 😞

  • mmollet Profile Picture
    3,187 on at

    We will figure it out for sure! 

     

    First I want to confirm that I understand what you are needing. 

    You have a gallery that is linked to a SP list?

    You want to only show items in that gallery that the current user created?

     

    Also I believe that CreateBy returns the FullName not the Email now that I am looking at it so first you should try:

    Filter('NEST Intake System','Created By'=User().FullName)

    Im hoping that just fixes it. Sorry for bad info yesterday!

  • ShondaT Profile Picture
    228 on at

     

    @mmollet You are correct! That's exactly what I'm trying to do.

     

    It doesn't seem to like the "=". I get the red squiggly.

     

    I tried doing 'Created by'.FullName=User().Fullname) just for kicks. "Fullname for Created By doesn't even appear as an option like "email" does. 

     

    When the code appears to be error free, it just comes back with "We didn't find any data."

     

    I've also tried the code on my "Requestor" column which autopopulates with the current user's name as a result of the following code added to the DefaultSelectedItems of the DataCardValue:

    If(NCAForm_1.Mode = FormMode.New, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:Concatenate("i:0#.f|membership|",User().Email), DisplayName:User().FullName, Email:User().Email}, ThisItem.Requestor)

     

    Maybe something in that code can help identify a possible solution?

     

    By the way thank you so much for your time and really wanting to help me figure this out. 🙂

     

     

     

  • mmollet Profile Picture
    3,187 on at

    Have you tried just make a new screen and dropping in a gallery. Just delete everything out of it and add a textbox or 2 with the important data so you know what it is showing is correct such as wherever you are storing the user name. Then set the items property to the code I sent previously and see if it works on a more simple gallery. If it does then you can be sure that it isnt that code. I have a gallery here that is working with the filter I provided but the set up and other parts are obviously not the same as what you have. When I get stuck like this I generally try to start from the most basic element and then add functionality until I figure out what the issue is. 

     

    To check what is stored in 'Created By' you could always go into the list settings for that list and then show that column and see what value it has. When I did this it just had Full Name of the user stored in it. 

     

    Also NP! I am going to do my best to get this resolved today just hang in there 🙂

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,070

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 608

Last 30 days Overall leaderboard