cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ADavis17
Regular 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
Regular 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
Regular 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
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,720)