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 / Problems with Lookups,...
Power Apps
Unanswered

Problems with Lookups, Defaults, and current user information. Values not saving to SharePoint

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have customized a few SharePoint list forms with Power Apps and I keep noticing the same problems. 

 

For all of them, I need to get the current user's email, use it in a lookup, and have fields auto-populate. It seems to always work fine for me, but when I look at what other people are entering, I can see that the lookups aren't pulling anything (they're pulling info that is there for everybody, so I've ruled out the possibility that the data is empty for them). It just seems like for random users it's not working and I cannot pinpoint a cause. I'll explain one example in detail here: 

 

In the Default property of a text box named EmailText inside a datacard: User().Email

 

In the Default property of a text box named HoursText inside a datacard: LookUp('DataSource', Email = EmailText.Text && Week = WeekDropdown.Selected.Result, wHours)

 

On saving the form, the Hours column appears empty for some people. I have also tried using the OnVisible property of the form to set a variable with the email of the current user, then use that variable in a lookup with the same results. I've tried putting the lookup in the Update property of the datacards with the same result. I just need this to be consistent, so if there's a best practice way of doing this, I would love to know!

Categories:
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    I can't guarantee this will help, but the first thing I woould try is to store the current user email as a variable when the app starts and use that variable wherever you are currently using user().Email.  I've seen a lot of issues with user().email inside formulas since it can't be delegated.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I appreciate the suggestion! I was actually doing that in another form with the form's OnVisible property, but I just moved it to the app OnStart property, so we'll see if that makes a difference. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Anonymous 

    Hi,

    This piece of code appears to look for records in a data source without an alternative if there aren't any:

     

    "In the Default property of a text box named HoursText inside a datacard: LookUp('DataSource', Email = EmailText.Text && Week = WeekDropdown.Selected.Result, wHours)"

     

    What I mean is, if there isn't a match for the LookUp then the Hours value will likely return Blank. This would most likely happen when a user sees an Hrs value in say a dropdown, thinks "Yep, that's right", but doesn't select it. Because a value isn't selected the Default value (sometimes blank as per above) is stored.

     

    A way around this would be to write an If() statement, something like:

     

    If( IsBlank( [your current Lookup] ), [ set your Hrs preference here ], [ your current Lookup] )

     

    I could be way off though but that's what I can see maybe happening?

     

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard