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 / Office365Users.UserPro...
Power Apps
Unanswered

Office365Users.UserProfile doesnt like an email with a single quote in it

(0) ShareShare
ReportReport
Posted on by 377

Hi

I am trying to get a users display name and department.

It works fine with ...

 

galRequests.Selected.MatterPartner.DisplayName & " (" & Office365Users.UserProfile(galRequests.Selected.MatterPartner.Email).Department & ")"

 

However if the MatterPartner DisplayName or Email has a single quote

John.O'Byrne@contoso.com

it gives an error.

 

Thanks

P

 

 

Categories:
  • WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Hi @pmwhelan ,

    Yes - I now have OSullivan and ONeill in AD - you will have many more issues with this in things like embedded links and URL parameters - I have simply given up . . .

  • pmwhelan Profile Picture
    377 on at

    Trying 

    galRequests.Selected.MatterPartner.DisplayName & " (" & Office365Users.UserProfile(Replace(galRequests.Selected.MatterPartner.Email, "'", "")).Department & ")"

    says

    "Error in this formula"

  • pmwhelan Profile Picture
    377 on at

    Well that sucks! 

    Thanks for the input.

     

    I tried a workaround and opened a new question

    https://powerusers.microsoft.com/t5/Building-Power-Apps/JSON-parsing-error-expected-object-but-got-array/m-p/2143681#M536347

  • WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    @pmwhelan ,

    If you manage to solve it, post back here . . .

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

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard