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 / Office 365 User lookup...
Power Apps
Answered

Office 365 User lookup produces error (invalid User ID), but performs

(0) ShareShare
ReportReport
Posted on by 2 Moderator

I have a strange problem.

 

'Office365-Benutzer'.UserProfileV2(LookUp(Sort(BVJ_Schülerzahlen; Created; Descending); Direktorat = vardirektorat; 'Meldende Person')).displayName

 

This gives me the name I'm looking for. But sometimes when I start the app, on my phone, it produces an error message in the first two lines about the user id being invalid.

Any ideas? I don't want to annoy the people who use the app.

 

Thanks! 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @schwibach ,

     

    Could you tell me:

    1. What/s the data type of ‘Direktorat’ column? Is it a ‘Single line of text’ column?
    2. What’s ‘vardirektorat’? Is it a variable defined in canvas?
    3. What’s 'Meldende Person' column? Is it a ‘Single line of text’ column? Does it store users’ email?

     

    If my assumptions are correct ,I think the problem is the variable ‘vardirektorat’.

    Sometimes, the variable has not been assigned. So it find an empty record and the formula reported an error.

     

    You could try the following formula:

     

    If(!IsBlank(vardirektorat),'Office365-Benutzer'.UserProfileV2(LookUp(Sort(BVJ_Schülerzahlen; Created; Descending); Direktorat = vardirektorat; 'Meldende Person')).displayName, "Please assign a value to the variable first")

     

     

    Best Regards,

    Wearsky

    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • schwibach Profile Picture
    2 Moderator on at

    Thanks a lot!
    That worked. It's strange because defining the variable is the first thing I do on start.

     

    I can only imagine that if the response from Sharepoint is not instant, the program recognises that for a moment there is no value, gives back the error, which in turn is immediately fixed.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard