web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / People Pickers stopped...
Power Apps
Answered

People Pickers stopped working in app - code that was working fine no longer does so.

(0) ShareShare
ReportReport
Posted on by 11
I have a Power Apps canvas app that has a number of people pickers - classic combo boxes with SharePoint list person columns as a backend. These used to work fine, all data was pulled in from the Office 365 connectors.  Now, all of them have stopped working properly.
 
Below is a sample Update property, the user is found and DisplayName shows up fine, but Mail is blank. This causes a variety of errors.  I have tried all kinds of fixes and workarounds, and variations in the code, but the basic issue is still there - it used to work and now it doesn't.  I have tried deleting the Office 365 connector and reattaching it, but that didn't make a difference. Does anyone have any ideas as to what could cause this? Thanks!
     If(
        IsBlank(cmbSupervisor2MP.Selected.Mail),
        Blank(),
        {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims: "i:0#.f|membership|" & cmbSupervisor2MP.Selected.Mail,
            Department: "",
            DisplayName: cmbSupervisor2MP.Selected.DisplayName,
            Email: cmbSupervisor2MP.Selected.Mail,
            JobTitle: "",
            Picture: ""
        }
    )
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    5,502 Super User 2025 Season 2 on at
     
    Try this formula does it resolve or not.
    With(
        {
            profile: Office365Users.UserProfileV2(cmbSupervisor2MP.Selected.Id),
            upnOrEmail: Coalesce(profile.mail, profile.userPrincipalName)
        },
        If(
            IsBlank(upnOrEmail),
            Blank(),
            {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                Claims: "i:0#.f|membership|" & Lower(upnOrEmail),
                DisplayName: profile.displayName,
                Email: upnOrEmail,
                Department: profile.department,
                JobTitle: Coalesce(profile.jobTitle, "")
            }
        )
    ) 
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • WarrenBelz Profile Picture
    153,462 Most Valuable Professional on at
    Adding to what @MS.Ragavendar has posted, this blog of mine may also be of some use to you.
  • Suggested answer
    MS.Ragavendar Profile Picture
    5,502 Super User 2025 Season 2 on at
     
    A quick follow-up to see, does the suggestion worked for you or still you were looking for any other approaches or assistance.
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • CU25120131-0 Profile Picture
    11 on at
    Thank you and  very much for your help! This has really helped me to hone in on where the problem is. The following people picker Update code works beautifully now except in the following circumstances: the form is opened in edit mode, there is already a name from Parent.Default, and the form is re-saved without selecting a new name. At that point, the field doesn't see the email of the person who was pulled in from Parent.Default so saves a blank. 
     
    So this is really back to the original issue - the people picker isn't pulling in the person's email unless something has changed. All that is pulled in is DisplayName, JobTitle (which I don't need) and Department (which I also don't need). No mail/email or UserPrincipalName. This is what broken ... all the data used to be available, and no longer is.
     
    With(
        {
            profile: Office365Users.UserProfileV2(cmbSupervisorMP.Selected.Id),
            upnOrEmail: Coalesce(cmbSupervisorMP.Selected.Mail, cmbSupervisorMP.Selected.UserPrincipalName)
        },
        If(
            IsBlank(upnOrEmail),
            Blank(),
            {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                Claims: "i:0#.f|membership|" & Lower(upnOrEmail),
                DisplayName: profile.displayName,
                Email: upnOrEmail,
                Department: profile.department,
                JobTitle: Coalesce(profile.jobTitle, "")
            }
        )
    )

    In case it is helpful, this is what is in Items:
     
    Office365Users.SearchUserV2(
        {
            searchTerm: Trim(Self.SearchText),
            isSearchTermRequired: false
        }
    ).value
     
    All the person data is available in "value".
     
    Thank you!
     
  • Suggested answer
    WarrenBelz Profile Picture
    153,462 Most Valuable Professional on at
    I did not get a notification on this - just saw it now.
     
    Firstly, the DefaultSelectedItems of cmbSupervisorMP - using the Person Field name (I assume a single choice) you are writing to - is it something like this?
    {
        DisplayName: ThisItem.PersonFieldName.DisplayName,
        Mail: ThisItem.PersonFieldName.Email
    }
    The issue is that unless the Items user table is fully populated by selecting a record, then neither the UserPrincipalName nor the Id are going to be available as a Person field does not contain these. So try something like this instead: -
    With(
       {_User: Office365Users.UserProfileV2(ThisItem.PersonFieldName.Email)},
       {
          DisplayName: _User.displayName,
          Mail: _User.mail,
          Id: _User.id,
          UserPrincipalName: _User.userPrincipalName,
          Department: _User.department,
          JobTitle: _User.jobTitle
       }
    )
    Then your Update should only need this
    If(
       IsBlank(cmbSupervisorMP.Selected.UserPrincipalName),
       {},
       {
          Claims:  "i:0#.f|membership|" & Lower(cmbSupervisorMP.Selected.Mail),
          DisplayName: cmbSupervisorMP.Selected.DisplayName,
          Email: cmbSupervisorMP.Selected.Mail,
          Department: cmbSupervisorMP.Selected.Department,
          JobTitle: cmbSupervisorMP.Selected.JobTitle,
          Picture: ""
       }
    )
    You may need to use the Id - I am not totally clear on your process logic here.
     
    Also you do not need the  '@odata.type':  reference any more.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • CU25120131-0 Profile Picture
    11 on at
    Thank you again for your help @WarrenBelz. I tried this and am getting the error messages:  Invalid argument type cmbInterConMgrMP.SearchItems.  and
    The function "Search" has some invalid arguments.  It does not seem to like the Items code above.  What else is needed?  Thanks!
  • Verified answer
    WarrenBelz Profile Picture
    153,462 Most Valuable Professional on at
    How many Combo Boxes are we dealing with here ? The latest one cmbInterConMgrMP is not mentioned in your post (or is it cmbSupervisorMP renamed?) - the response below assumes one Combo Box is involved in all of this (please confirm if Classic or Moderen control) - if this is incorrect, a short explanation of your process would be helpful.
     
    My understanding of your issue is that you have a Combo Box with the Items 
    Office365Users.SearchUserV2(
       {
          searchTerm: Trim(Self.SearchText),
          isSearchTermRequired: false
       }
    ).value
    where the output of any selected item includes the DisplayNameMailUserPrincipalName and Id (among other fields), however if the user does not select any item, then you only have the DefaultSelectedItems which you probably set something like
    {DisplayName: ThisItem.PersonFieldName.DisplayName}
    The issue (as you have realised) is that the fields you require are not there, so you need to include then in the DefaultSelectedItems. If you only need the Mail field as well, you can do this (and this may be the solution)
    {
       DisplayName: ThisItem.PersonFieldName.DisplayName,
       Mail: ThisItem.PersonFieldName.Email
    }
    and the Data Card Update
    {
       Claims: "i:0#.f|membership|" & Lower(cmbSupervisorMP.Selected.Mail),       
       DisplayName: cmbSupervisorMP.Selected.DisplayName,
       Department: "",
       Email: cmbSupervisorMP.Selected.Mail,     
       JobTitle: "",
       Picture: ""
    }
    The DisplayFields (assuming you are displaying the User's name) should be
    ["DisplayName"]
    However, if you want to retreive the UserPrincipalName and Id in the DefaultSelectedItems, you need to do it something like this
    With(
       {_User: Office365Users.UserProfileV2(ThisItem.PersonFieldName.Email)},
       {
          DisplayName: _User.displayName,
          Mail: _User.mail,
          Id: _User.id,
          UserPrincipalName: _User.userPrincipalName,
          Department: _User.department,
          JobTitle: _User.jobTitle
       }
    )
    and then the Data Card Update
    {
       Claims:  "i:0#.f|membership|" & Lower(cmbSupervisorMP.Selected.Mail),
       DisplayName: cmbSupervisorMP.Selected.DisplayName,
       Email: cmbSupervisorMP.Selected.Mail,
       Department: cmbSupervisorMP.Selected.Department,
       JobTitle: cmbSupervisorMP.Selected.JobTitle,
       Picture: ""
    }
    
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • CU25120131-0 Profile Picture
    11 on at
    Thank you for the additional clarification @WarrenBelz!  I had to make one little change to allow it to save blanks, but now everything appears to be working perfectly. I have been working on these people pickers for some time (I have about 20 of them of various complexity) and they have not been cooperating since whatever happened to make them all break occurred.  I was beginning to fear I would have to discard this app - which I've been working on for months - so thank you again!
     
     
     
     
  • WarrenBelz Profile Picture
    153,462 Most Valuable Professional on at
    I am not sure which option was the solution, but if the first the blog I posted earlier should be a good guide for different scenarios.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard