Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Default Combbox to Office365Users displayName

I know there are several posts about this but for some reason I am struggling with solving this one.  First my setup:  I am NOT using a standard form on the screen.  I am using my own controls and then a Patch statement to save/update records.   The combobox Items is: Office365Users.SearchUser({searchTerm:cmbRequestor.SearchText}).DisplayName.  All is fine and well there.  This combobox is patched back to a person field in a SharePoint list.  In this field, only one person can be selected.  I do not allow multiple selections.


I have a variable named CurrentMode which can be New, Edit, View, based on the current state of the application and the assumption made is that if the user is not CREATING a new record then they have searched for a record, the app stored the main ID in a variable and then a search gallery populates with the searched items.   All I want to do is display the name that was saved in the SharePoint list record, but have the user be able to EDIT that name if necessary.


In the Defaults Section I have tried doing something like If(CurrentMode<>"New",Office365Users.SearchUser({searchTerm:ResultsGallery.Selected.Requestor}).DisplayName,false) but I keep getting some error about expecting a record value.  I have also tried appending .value.DisplayName, but get the same.  

Super User
Super User

The Combo box returns an entire record, and the Person field requires a record, you are trying to get it to force it to a single field, that's why you are getting the error.

The Combo box will return the entire record. If you want to see only one field of the record, that is possible with the Combo box. The SearchUser function is now on V2, I would switch to that. To really know where the error is we would need to know how you are setting searchTerm and what the Gallery Requestor is

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,347)