cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

View display with Office365Users combobox

I have created a screen that uses individual controls to databind back to the datasource and then I am using Patch to save the data.  All works good.  Now I have created a search screen that searches records based on criteria like RequestNumber, startDate, endDate, etc...this also works, populating a Results Gallery with the search results.  I want the user to be able to select a record in the results gallery and then set the Default values in the form based on ThisItem.Field.  All of this also works except for the person fields.  These are comboboxes that use the Office365Users source to choose data.  I have tried just using the ThisItem.Email, or doing a new Office365User.SearchUser...I have the user displayname and email in ThisItem, but I keep getting either and "expecting table" error or "text" error.

 

I do have this and it does not error, but there is no data: First(Office365Users.SearchUser({searchTerm:SelectedRequestor}).DisplayName)

 

Thanks for the information and help

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Anonymous,

Do you want to populate the Combo Box with the Gallery selected record?

Could you please tell me that:

  1. how you set the Items property of the Combo Box and how you set the Items of your Gallery?
  2. what is the data type of the column corresponding to the Combo Box, a Person field in SP list?
  3. provide a screenshot to tell me how you configure your gallery and form?

Actually, which record displays in the Form depends on gallery selected, how you set the Items property of the Gallery and the key property of the control corresponding to the person fields.

I assume that you have a general gallery including Labels within to display person names, and a form including Combo Box to select person names.

Please set the Items of the Combo Box within the form as below:

Choices([@SPList2].'Name') // Name is your Person field name, replace it with yours.

Set the DefaultSelectedItems of the Combo Box within the form as below:

ThisItem.Name

Or please add a "[" and "]" to format the ThisItem.PersonField as below:

[ThisItem.PersonField]

Check if this could help.

Regards,

Qi

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @Anonymous,

Do you want to populate the Combo Box with the Gallery selected record?

Could you please tell me that:

  1. how you set the Items property of the Combo Box and how you set the Items of your Gallery?
  2. what is the data type of the column corresponding to the Combo Box, a Person field in SP list?
  3. provide a screenshot to tell me how you configure your gallery and form?

Actually, which record displays in the Form depends on gallery selected, how you set the Items property of the Gallery and the key property of the control corresponding to the person fields.

I assume that you have a general gallery including Labels within to display person names, and a form including Combo Box to select person names.

Please set the Items of the Combo Box within the form as below:

Choices([@SPList2].'Name') // Name is your Person field name, replace it with yours.

Set the DefaultSelectedItems of the Combo Box within the form as below:

ThisItem.Name

Or please add a "[" and "]" to format the ThisItem.PersonField as below:

[ThisItem.PersonField]

Check if this could help.

Regards,

Qi

Best Regards,
Qi
Anonymous
Not applicable

Thanks Qi!  This is what I needed.  The Choices function

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (1,843)