cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
guyinkalamazoo
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.  

1 REPLY 1
BrianS
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

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,234)