Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 272
  • I am using an EditForm control
  • The Inspector People field in your SharePoint list is configured to single-select
  • The Items property of that ComboBox control inside the DataCard for the Inspector field contains something along the lines of:

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)
 

I did two test Test 3 and Test 0044. 

Test 3 - Does not show Inspector name in SharePoint(added image for reference). 

Test 0044 - Does show Inspector name in SharePoint, also showing error in Power apps records(added image for reference). 

What could be the error.

 

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-1717427486293.png

 

mtsts_1-1717427503454.png

 

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

    @Cr1t  I tried the person column menthod.

     

    It gives me same error in the records(added image as reference) while i am testing the app.

     

    mtsts_0-1717516060018.png

     

  • Cr1t Profile Picture
    Cr1t 555 on at
    Re: Auto populate Person Column(based on user login) in canvas app error

    @mtsts 

    Could you please provide me more info so i can help you better? Is it a Person column or have you used a combobox connected to office 365 connector?

    If it is a person column please follow these steps:
    Items property: 

     

    Choices([@'Walk Through Inspection Checklist 2024'].Inspector)

     

    Default property:

     

    {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     DisplayName: User().FullName,
     Claims: "i:0#.f|membership|" & Lower(User().Email),
     Department: "",
     Email: User().Email,
     JobTitle: "",
     Picture: ""
    }

     

    DefaultSelectedItems:

     

    { 
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", 
    DisplayName:User().FullName, 
    Claims:"i:0#.f|membership|" & Lower(User().Email), 
    Department:"", 
    Email:User().Email, 
    JobTitle:"", 
    Picture:"" 
    }

     

    DisplayFields:

     

    ["DisplayName"]

     


    If you are using office 365 connector for combobox then please follow the below steps:
    Items property of combobox:

     

    Office365Users.SearchUserV2(
     {
     searchTerm: yourcombobox.SearchText,
     top: 50,
     isSearchTermRequired: false
     }
    )

     

    DisplayFields property:

     

    ["DisplayName","Mail"]

     


    SearchFields property:

     

    ["DisplayName","Mail"]

     


    Update property of the people picker card:

     

    {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "i:0#.f|membership|"&yourcombobox.Selected.Mail,
     Department: "",
     DisplayName: yourcombobox.Selected.DisplayName,
     Email: yourcombobox.Selected.Mail,
     JobTitle: "",
     Picture: ""
    }

     


    Please let me know if this works for you. 
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




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

    @Cr1t Thanks much for helping. 

     

    I am using Office365Users as a connector.

  • Cr1t Profile Picture
    Cr1t 555 on at
    Re: Auto populate Person Column(based on user login) in canvas app error

    @mtsts 

    I have create a sharepoint list with 2 columns Text and Submitted by, 

    Cr1t_2-1717428910334.png

     

     


    Select the people picker datacard and set the Default and DefaultSelectedItems property as 

     

    {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     DisplayName: User().FullName,
     Claims: "i:0#.f|membership|" & Lower(User().Email),
     Department: "",
     Email: User().Email,
     JobTitle: "",
     Picture: ""
    }

     

    Cr1t_5-1717428910503.png

     

    Cr1t_6-1717428910509.png

     


    The person column should display the user name 

     

    Cr1t_7-1717428910409.png

     

     

     

    No the right hand side click edit on fields .

    Cr1t_0-1717428804547.png

     

     

    Please set the primary text and search field to DisplayName.

    Cr1t_1-1717428804433.png

     


    Save and preview the app. 

    Please let me know if this works for you. 
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard