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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default Selected item ...
Power Apps
Answered

Default Selected item person field Sharepoint

(0) ShareShare
ReportReport
Posted on by 434

Hi All

 

I have SharePoint person field added on one my forms.

 

I have one datacard and value : Datacardpersonvalue

I have added value to it with the help of DefaultselectedItems property.

I was able to set value correctly but now when i try to read selected value it gives only display name and other fields are blank.

 

Datacardpersonvalue.Selected.DisplayName : Gives correct name

Datacardpersonvalue.Selected.Email : gives blank value, I need this email address.

 

Please hlp.

 

Thanks in Advance.

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @vish3027 

    What are the Items property and the DefaultSelectedItems property of the Combobox?

     

  • vish3027 Profile Picture
    434 on at

    @RandyHayes 

     

    Items : 

    Choices([@'FM Request'].'Functional Approver 3')
     
    DefaultSelectedItems :
    If(
    newFMR && !IsBlank(First(SelectedApproverRoles.field_Approver_x0020_3).'Approver 3'),
    LookUp(
    'F&M Role wise Approvers',
    'Role (FN5)'.Value = First(SelectedApproverRoles.field_Approver_x0020_3).'Approver 3' && Country.Value = DataCardValueFMCountry.Selected.Title && Sector.Value = DataCardValueFMSector.Selected.Value,
    If(
    !IsBlank(UsersName.Email),
    First(UserIDOffice365.SearchUser({searchTerm: UsersName.Email}))
    )
    ),
    Parent.Default
    )
     
    Highlighted part sets the value, I have collections and based on the filter i am pulling the value from SharePoint list.
    It pulls value correctly and shows display name correctly.
     
    Thanks
  • vish3027 Profile Picture
    434 on at

    Also I need email because there are multiple users with same name and thats creating issues.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @vish3027 

    Your Items property is based on SharePoint Users.  Your DefaultSelectedItems (DSI) property is based on Office 365 Users.  These are two different type of user records.  We need to change that.

     

    First though, you are then looking up from the 'F&M Role wise Approvers' list.  I assume that is a SharePoint list and has a column called UsersName that is a People column as well?

    Please verify.

     

  • vish3027 Profile Picture
    434 on at

    @RandyHayes  Yes, UserName is person field with only single value.

     

    Also if i have custom dropdown value for combobox from list of users, in that case also we face same issue.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @vish3027 

    In this case, I would remove the Office 365 part from your formula as you already have all the SharePoint user records defined.

     

    Your Items property would remain as : Choices([@'FM Request'].'Functional Approver 3')

    And your DefaultSelectedItems property should be:

    Coalesce(
     Parent.Default,
     LookUp('F&M Role wise Approvers',
     'Role (FN5)'.Value = First(SelectedApproverRoles.field_Approver_x0020_3).'Approver 3' &&
     Country.Value = DataCardValueFMCountry.Selected.Title && 
     Sector.Value = DataCardValueFMSector.Selected.Value,
     UsersName
     )
    )
    

    I am not sure what your SelectedApproverRoles is in the formula, so I am assuming that is correct based on what you have.

     

    Make sure also that your Update property of the datacard is set to:

        yourUserCombobox.Selected

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,041

#2
11manish Profile Picture

11manish 676

#3
Valantis Profile Picture

Valantis 655

Last 30 days Overall leaderboard