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 / Have default Display N...
Power Apps
Unanswered

Have default Display Name in people picker

(1) ShareShare
ReportReport
Posted on by 215

Hello, I am trying to get default display name in the people picker based on the other field. In my scenario, based on the Visiting Area chosen in a combo box, I would like to set specific Manager Name. This is only to show the default person in the people picker. If the user needs to change, the user should be able to remove the default person and select a different person by searching. 

 

May I please know how to achieve this? Attaching the image. 

I tried the below code. It comes up with an error If( "ABCD" in VisitingAreaDataCardValue12.SelectedItems, DataCardValue16.Value="Firstname Lastname", Parent.Default )

Img1.PNG
Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @PowerUser19 

     

    You don't do this in Power Apps:

     

    //don't do this to try to set DataCardValue16.Value
    DataCardValue16.Value="Firstname Lastname"
    //don't try to set DataCardValue16.Value directly in a formula.
    //the only reason to say 
    //DataCardValue16.Value="Firstname Lastname" 
    //is if you want to check if DataCardValue16.Value is equal to "Firstname Lastname" - but this will not set the value of the data card.

     

    You do not set the "Property.Value" directly in Power Apps using an equal sign.

    = means "check if the left side is equal to the right side" - it never sets anything.

     

    Whenever you want to say Something.Value = "Something else" to set a value of something - remember not to do that in Power Apps - you only do that if you want to compare if Something.Value is equal to "Something else".

    You should approach this another way in Power Apps.

     

    "Control.Value" of something can be accessed from elsewhere, but it is not to be "set" directly in the way you are attempting, in Power Apps.

     

    To achieve what you want where something has a default value,

     

    just use the Default property of the control.

    For example, Drop down control has a Default property which could be used for this purpose.

    Drop down control key properties - docs.microsoft.com

     

    When the Default property is used, suppose on a Drop down control called Dropdown1 - if the user does not change anything in Dropdown1, then Dropdown1.Selected.Value - when accessed from elsewhere, should match what's in the Default property of Dropdown1.

     

    For a Combo box control, it would be DefaultSelectedItems

    Key properties of Combo box controls - docs.microsoft.com

     

    Check if it helps @PowerUser19 

  • PowerUser19 Profile Picture
    215 on at

    @poweractivate  Thank you for letting me know! Is it possible to guide how to achieve this using Default property? I actually had my code in the original post written in the Default property but I understand it is incorrect.

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @PowerUser19 

     

    First, try to not use DataCardValue16.Value="Firstname Lastname" anywhere in the formula, I told you to make sure not to use it in my initial post, as attempting to use SomeControl.Value = "Some String" tells Power Apps to compare SomeControl.Value with "Some String"  - it does not tell Power Apps to change SomeControl.Value.

    Instead, just use "Firstname Lastname" and use it in the Default property of the Control, like the following :

     

    //use this in Default property of the Control
    If( "ABCD" in VisitingAreaDataCardValue12.SelectedItems, "Firstname Lastname", Parent.Default )

     

    If the above doesn't work, 
    try each of these for Default property, and see which one gives the error first:

    "Firstname Lastname"

     

    Parent.Default

     

    VisitingAreaDataCardValue12.SelectedItems

     

    "ABCD" in VisitingAreaDataCardValue12.SelectedItems
    //should put "true" or "false" as the default value

     

    For whichever of the above gives the error, correct it, and then correct it in the If function.

     

    If this still does not work and no error is shown with any of the above, let me know if you could provide more details on the specific error that is shown. Also, if you see an error with the above, but are unsure how to correct it based on what the error says, provide the details of the error as well.

  • PowerUser19 Profile Picture
    215 on at

    Hi @poweractivate ,

    Thanks for the response. Please excuse my ignorance here. I am learning while I build this app.

    I get "Invalid Argument Type (Record) Expected Text Value instead" 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

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard