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

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Combo box DefaultSelectedItem is not working with Office365Users.SearchUser

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
Microsoft
Microsoft

Re: Combo box DefaultSelectedItem is not working with Office365Users.SearchUser

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

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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