cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gj84uw
Advocate III
Advocate III

People Picker field in Azure SQL

I have got an app setup that connects to a table in an Azure SQL database and I want to add a people picker type field to this so a user from the Office 365 tenant can be searched for and selected.  I have followed the instructions here and this allows me to search for a user and save my form in the app, which successfully saves the user display name to my SQL table.

However, if I go into the edit form for the same record the people picker field appears blank.  I'm not quite sure why this is and wondered if anyone had any ideas and how I could resolve it?  For reference the Items and Update properties for the people picker field are below:

Items

If(!IsBlank(Trim(DataCardValue41.SearchText)), Office365Users.SearchUser({searchTerm: Trim(DataCardValue41.SearchText), top: 15}))

Update

If(Len(DataCardValue41.Selected.DisplayName)=0,
ThisItem.PersonResponsible,
DataCardValue41.Selected.DisplayName

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @gj84uw ,

 

Do you mean when the form is in the Edit mode the Combo Box is empty with no display name?

 

As per your description, I think the problem is caused by the DefaultSelectedItem of the Combo Box. Since the field in SQL is a text type with content of Display name, it should be set to:

 

Office365Users.SearchUser({searchTerm:ThisItem.DisplayName })

 

Basically, a Combo Box have 2 most important properties, Items defines what in it and DefaultSelectedItems defines which one or ones be selected by default.

 

The Update of the form would just need to be set to DataCardValue41.Selected.DisplayName since in New mode user would select in the Combo Box and in Edit mode or View mode the item stored in data source would be shown in the combo box unless it is empty in data source then user could select one or ones to update.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @gj84uw ,

 

Do you mean when the form is in the Edit mode the Combo Box is empty with no display name?

 

As per your description, I think the problem is caused by the DefaultSelectedItem of the Combo Box. Since the field in SQL is a text type with content of Display name, it should be set to:

 

Office365Users.SearchUser({searchTerm:ThisItem.DisplayName })

 

Basically, a Combo Box have 2 most important properties, Items defines what in it and DefaultSelectedItems defines which one or ones be selected by default.

 

The Update of the form would just need to be set to DataCardValue41.Selected.DisplayName since in New mode user would select in the Combo Box and in Edit mode or View mode the item stored in data source would be shown in the combo box unless it is empty in data source then user could select one or ones to update.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,361)