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 / How to convert display...
Power Apps
Answered

How to convert display name to string

(0) ShareShare
ReportReport
Posted on by 15

Hi, 

I'm currently designing an app for a business case. One of the requirements is that it has to save employee names, even after they left the organisation and their account is purged from the Active Directory. The app works on a SharePoint List.

 

I think I can manage this by adding two Data value fields in my app (see picture): 
1st field: person/group selector
2nd field: single line of text

Where the 2nd field retains the string of the DisplayName indefinitely, even when the user profile is deleted from AD. 

 

app.jpg

What I want to achieve is extracting the Display Name out of the selected item in the 1st field, and copying it, as a string, into the 2nd field. 

I have been able to solve this issue with single values before, but right now I either get the 'expects text, but instead it receives a table'-error, or I managed to copy the Display Name onto the 2nd field, but it didn't work in the user experience as I can't figure out how to run the copy-function after selecting the employee. This causes the function to run at loading of the screen, not after selecting the employee in the 1st column. 

Has anyone encountered this, or knows how to delay the function running until I have selected an employee? 

Categories:
I have the same question (0)
  • CU11011415-0 Profile Picture
    472 on at

    You should be able to set the Text property of your Name Employee field like this:

     ddEmployee.Selected.Value

  • Thijsvan1010 Profile Picture
    15 on at

    Yeah, 

    one of the methods I tried was adding an OnSelect-function in the 1st field, which sets a global variable, which is then loaded as a Default-function into the 2nd field. 

    This works when I want to edit an entry. It doesn't work when I create one, since the Default-function runs as soon as the page is loaded, at which time the global variable is still an empty variable. So I need to find a delay for that Default-function to run after I selected the item in the 1st field.

  • Verified answer
    Thijsvan1010 Profile Picture
    15 on at

    Fixed it. 

    The Powerapp studio autofills, which caused me to continue to continue along the wrong path. 

    The right answer is: 

    You select the #2 input field's DataCard, in the righthand panel you see the slot called 'update'. In there you type:
    EmployeeValueX.Selected.DisplayName (where EmployeeValueX points to the name of the People Picker field's DataCardValue, not the DataCard itself).


    The autofill of Powerapp constantly said I should type 'SelectedItems', causing it to load the entire table, instead of the single value. This in turn caused me to try and extract from the table, which could easily be done by typing 'Selected.DisplayName'

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
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard