cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

Combo box DefaultSelectedItem is not working with Office365Users.SearchUser

Hi,

 

Need help on Combo box DefaultSelectedItem property

 

I have developed a app in which i have used a combo box.

 

Combo box is NOT working properly when DisplayMode is EDIT for DefaultSelectedItems

 

* DefaultSelectedItems : it is showing as selected in Combobox but NOT actually selected the values in Edit mode
If(isEdit=1,If(IsBlank(DataTable.Selected.'EName')=false,[Parent.Default])) 

Attached screenshot.

I tried Filter function but it is not working

Filter(Office365Users.SearchUser({searchTerm:""}), DisplayName in Split(DataTable.Selected.'EName',","))

 

* Items: it is fine, can select multiple items and updates happening in back-end
Search(Office365Users.SearchUser({searchTerm:ComboBox_EName.SearchText}),"@microsoft.com","Mail")

 

Can you please help on this.

Thanks

Durga

3 REPLIES 3
Highlighted
Community Support
Community Support

Hi @Durga ,

Do you mean that you set a combo box's Items to :

Search(Office365Users.SearchUser({searchTerm:ComboBox_EName.SearchText}),"@microsoft.com","Mail")

set the combo box's  DefaultSelectedItems to :

If(isEdit=1,If(IsBlank(DataTable.Selected.'EName')=false,[Parent.Default])) 

?

Could you describe more clearly about the relationship between the combo box, DataTable and ComboBox_EName?

What's more, I'm not sure what is the logic in your DefaultSelectedItems formula, do you mean "And" between two conditions?

May be you could try:

If(isEdit=1&&IsBlank(DataTable.Selected.'EName')=false,Parent.Default) 

Also, the DefaultSelectedItems only display when the combo box is initialization。

If you want it to display the DefaultSelectedItems, you need to set this in one behavior property:

Reset(combo box name)

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Hi @v-yutliu-msft ,

 

Thanks for your reply, I tried your option also but not working

 

Here I explained my requirement in detail:

I have developed a PowerApp, it contains two screens

  1. Main Screen
  2. Edit Screen

 

In Main Screen:

Its DataTable

SNO

Ename

 

1

User1

Edit

2

User1, User2

Edit

 

Ename is the database table field and referring same it as Ename in DataTable

 

I want to auto populate the Combo Box with the user names selected previously and have the option to select more users or remove the ones already selected

 

 

In Edit Screen:

ComboBox_EName

Items = Search(Office365Users.SearchUser({searchTerm:ComboBox_Ename.SearchText}),"@microsoft.com","Mail")

 

DefaultSelectedItems = Office365Users.SearchUser({searchTerm: Parent.Default}).DisplayName

 

 

This solution only works if I select one User, when I have multiple users selected nothing works, the problem seems to be that the usernames are comma separated in one single string.

 

Thanks

Durga

Highlighted
Regular Visitor

Having the same problem - found a solution?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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