cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
guyinkalamazoo
Helper I
Helper I

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,093)