title: User principal name vs mail in Graph Users
body: <p>I am listing users from SharePoint into custom database table for use in custom application. While adding these users to custom database we need the user Id from Azure Active Directory (not user ID from SharePoint).</p>
  
  <p>So based on email of user from SharePoint I search the user in Azure AD and get the ID.</p>
  
  <p>For some users I see that Mail field from Graph User object is null but has User Principal Name field filled with email. And for other users has both Mail and User Principal Name filled.</p>
  
  <p>What is the reason Mail field for users is null? Which field should I rely on as email value?</p>
  
  <p>Thank you!</p>