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

Community site session details

Session Id : Wh9wQHIRTLFWeRzwIWLi7K
Power Apps - Building Power Apps
Answered

Set People Picker Field from Text String

Like (0) ShareShare
ReportReport
Posted on 1 Jul 2020 04:42:26 by 173

Hi all,

 

I have a Project Management app, where I would like to use People Picker field for "Project Lead" instead of text string, which we have used before.

 

What I have is the persons Name(text string) and E-mail address(text string). Now I want to populate a People Picker field using the Name or E-mail.

 

I am trying to use this code, but I get some error messages when trying:

 


UpdateIf(Projektlista; Projektfas.Value="05 Driva";
{
Projektledare: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
Department: "";
Claims: "i:0#.f|membership|" & 'E-mail';
DisplayName: DisplayName: Office365Users.UserProfileV2('E-mail').displayName;
Email: 'E-mail';
JobTitle: "";
Picture: ""
})

 

Can anyone help me out with this?

 

I have the same question (0)
  • JisungHan Profile Picture
    on 01 Jul 2020 at 08:08:53
    Re: Set People Picker Field from Text String

    Thanks @LennartWalldén for great solution!

  • Community Power Platform Member Profile Picture
    on 01 Jul 2020 at 08:05:35
    Re: Set People Picker Field from Text String

    @LennartWalldén 

    No worries mate, happy to have put you on the right path to a solution 🙂 

  • LennartWalldén Profile Picture
    173 on 01 Jul 2020 at 07:17:41
    Re: Set People Picker Field from Text String

    Hi @Anonymous,

     

    Thanks a lot for putting me on the right track, I just left the Displayname blank, and used lower on the E-mail address, and that did it!

    Your suggestions and the Shane Young video did really give me insight.

     

    I have been struggling with this for a while, so I am very glad that I finally could solve it. We have created a new SP list for our projects, where we will have more data stored thanks to PowerApps, and this update is a part of the conversion from the old SP list.

    Again, thank you very much!

    Best
    Lennart

  • Verified answer
    Community Power Platform Member Profile Picture
    on 01 Jul 2020 at 06:30:07
    Re: Set People Picker Field from Text String

    @LennartWalldén 

    Is there a reason why you cannot use a ComboBox with the Items property set to ... ?

    Choices([yourListName].yourPersonColumnName)

    Then the UpdateIf would just need

    ...{ ComboBox1.Selected } ...

    ie no need for all this code.

     

    If not, then 2 possible issues I can see with your code are:

    1. 'Email' in the Claims part should be in Lower case, eg

    ... 
    Claims: "i:0#.f|membership|" & lower('E-mail');
    ...

    2. The DisplayName is probably better accessed via a variable, eg

    Set(vDisplayName, Office365Users.UserProfileV2('E-mail').displayName);
    
    UpdateIf(...
    ...
    DisplayName: vDisplayName;
    ...
    )

     

    This Shane Young video may also help.

     

     

     

     

  • LennartWalldén Profile Picture
    173 on 01 Jul 2020 at 04:48:38
    Re: Set People Picker Field from Text String

    Sorry I made a mistake when copying the code to the post: It looks like this

     

    UpdateIf(Projektlista; Projektfas.Value="05 Driva";
    {
    Projektledare: {
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
    Department: "";
    Claims: "i:0#.f|membership|" & 'E-mail';
    DisplayName: Office365Users.UserProfileV2('E-mail').displayName;
    Email: 'E-mail';
    JobTitle: "";
    Picture: ""
    })

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 917 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 387 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 334 Super User 2025 Season 2

Last 30 days Overall leaderboard