cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ADavis17
Frequent Visitor

Office365Users.SearchUser - Cascading Combo Boxes

Hi, is there a way to create cascading combo boxes using the Office365Users.SearchUserV2 and have the second combo box auto populate based on the selected item from the first combo box?

This is my current setup for the cascading combo boxes.

The first combo box has this formula, Items= 

Office365Users.SearchUserV2({searchTerm:EmployeesName.SearchText}).value.DisplayName

The second combo box has this formula, Items= 

Office365Users.SearchUserV2({searchTerm:EmployeesName.SearchText}).value.Mail

Based on the search text the second combo box dropdown only include emails that match what was searched in the first box and you have to select from this list, which is great, but, I want the second box to auto fill based on the Selected Item instead of sorting based on the Search Text. 

 

To achieve this I have replaced the formula in the second combo box with, 

Distinct(EmployeesName.SelectedItems.DisplayName, Mail).Result

Instead of displaying the email address, it instead says "builtinicon:Mail", and it doesn't autofill, it has to be selected and its the only option. When I replace Mail with Display Name, the results show the Display Name of the Selected Item. 

 

I want the autofill, because I have users in the app filling in this information and then tend to select the wrong email from the dropdown and if I can autofill the selection, then I can avoid this headache. 

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
ADavis17
Frequent Visitor

After playing around with different things. I found a solution.

I used a TextInput to Concat the selected items from the first Combo Box and Instead of using a second Combo Box for the email I just used a TextInput to Concat the result from the first TextInput. Labels can be used as well. 

 

Setup.

ComboBox1, Items = Office365Users.SearchUserV2({searchTerm:ComboBox1.SearchText}).value.DisplayName

TextInput1, Default = Concat(ComboBox1.SelectedItems, DisplayName, " ")

 

TextInput2, Default = Concat(Office365Users.SearchUserV2({searchTerm:TextInput1.Text}).value.Mail,Mail)

 

If you want to use a second ComboBox just for looks the formula would just be 

Items = Office365Users.SearchUserV2({searchTerm:TextInput1.Text}).value.Mail

 

It's a nice simple work around that works exactly how I need it to.

View solution in original post

1 REPLY 1
ADavis17
Frequent Visitor

After playing around with different things. I found a solution.

I used a TextInput to Concat the selected items from the first Combo Box and Instead of using a second Combo Box for the email I just used a TextInput to Concat the result from the first TextInput. Labels can be used as well. 

 

Setup.

ComboBox1, Items = Office365Users.SearchUserV2({searchTerm:ComboBox1.SearchText}).value.DisplayName

TextInput1, Default = Concat(ComboBox1.SelectedItems, DisplayName, " ")

 

TextInput2, Default = Concat(Office365Users.SearchUserV2({searchTerm:TextInput1.Text}).value.Mail,Mail)

 

If you want to use a second ComboBox just for looks the formula would just be 

Items = Office365Users.SearchUserV2({searchTerm:TextInput1.Text}).value.Mail

 

It's a nice simple work around that works exactly how I need it to.

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 (4,058)