Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Auto populate Person Column(based on user login) in canvas app

(0) ShareShare
ReportReport
Posted on by 270

Hello everyone!

SharePoint list is connected to the PowerApp. I am trying to Auto populate Person Column in canvas app based on user name(so that user do not need to select his/her name) for column named as Inspector.

 

 

I tried the code  in DefaultSelectedItems property - 

 

{
    '@odata.type': "#Microsoft.Office.Connectors.SharePoint.SPListExpandedUser",
    DisplayName: User().FullName,
    Claims: "i:0#.f|membership|" & User().FullName,
    FullName: User().FullName
}
 

However it adds code in record history also( added image for reference).

 

 

mtsts_0-1717007412840.png

 

 

  • Verified answer
    FnuMeenu Profile Picture
    FnuMeenu 270 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @Amik Thanks much for helping.

    @mtsts 

    (The issue/error was - my record during testing the app was adding i:0#.f|membership|abc@xyz.com)

     

    I deleted subtitle from gallery. It solved my issue. Rest all working good. 

  • FnuMeenu Profile Picture
    FnuMeenu 270 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @Amik Yes. 

     Thanks much for helping. Appreciated!

     

    (The issue/error was - my record during testing the app was adding i:0#.f|membership|abc@xyz.com)

     

    I deleted subtitle from gallery. It solved my issue. Rest all working good. 

  • FnuMeenu Profile Picture
    FnuMeenu 270 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @Amik  Thanks much for helping. Appreciated.

     

    It is solved. The link with the solution is here as I posted a new topic for this -

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Auto-populate-Person-Column-based-on-user-login-in-canvas-app/m-p/2788426#M682414

  • FnuMeenu Profile Picture
    FnuMeenu 270 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @Amik  Thanks much for helping. Appreciated.

     

    It is solved. The link with the solution is here as I posted a new topic for this - https://powerusers.microsoft.com/t5/Building-Power-Apps/Auto-populate-Person-Column-based-on-user-login-in-canvas-app/m-p/2788426#M682414

  • Verified answer
    FnuMeenu Profile Picture
    FnuMeenu 270 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @Amik Thanks much for helping. Appreciated!

     

    (The issue/error was - my record during testing the app was adding i:0#.f|membership|abc@xyz.com)

    Added image for reference to show issue/error.

     

    I deleted subtitle from gallery. It solved my issue. Rest all working good. 

    Added image for reference after deleting Subtitle from gallery.

     

  • Verified answer
    Ami K Profile Picture
    Ami K 15,650 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @mtsts - sorry but you're not making sense here. In one post you have stated it not updating, but now it is updating?

     

    I do not see any errors in your screenshot. The reason the Claims token is appearing in your Gallery is because you should be using:

     

    ThisItem.'Your Inspector Field'.DisplayName
  • FnuMeenu Profile Picture
    FnuMeenu 270 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @Amik Yes it is being updated in SharePoint now however as in the image it is also adding a code with like that with the record name Test 0044, it is adding - i:0#.f|membership|abc@xyz.com

     

    mtsts_0-1717503618828.png

     

  • Ami K Profile Picture
    Ami K 15,650 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @mtsts - if I am understanding those screenshots correctly, "Test 0044" updated correctly, but "Test 3" did not?

  • FnuMeenu Profile Picture
    FnuMeenu 270 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @Amik No there is no error message.  I did two test Test 3 and Test 0044. Please look into that.

     

    Update Property 

     

    DataCardValue2.Selected
     
    DisplayMode
     
    Parent.DisplayMode
     
    DefaultSelectedItems
     
    Coalesce(
        Parent.Default,
        {
            Claims: "i:0#.f|membership|" & User().Email,
            Department: "",
            DisplayName: User().FullName,
            Email: User().Email,
            JobTitle: "",
            Picture: ""
        }
    )
     
     
    DisplayFields
     
    ["DisplayName"]
     
    SearchFields
     
    ["DisplayName","Email","Picture"]
     
    Items 
     
    Choices([@'Walk Through Inspection Checklist 2024'].Inspector)

     

    mtsts_0-1717417614447.png

     

    mtsts_1-1717417742001.png

     

     

  • Ami K Profile Picture
    Ami K 15,650 on at
    Re: Auto populate Person Column(based on user login) in canvas app

    @mtsts - is there an error message?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard