cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
patty789
Level: Powered On

How to make two combo box search to display the content and vice versa.

Hello,

 

I currently have two combo boxes one that shows all the addresses and the other one that has job numbers. How can i make both search either for address and display the job number, and search job number and display the address? Any help will be much appriciated. 

 

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to make two combo box search to display the content and vice versa.

Hi @patty789 ,

Do you want to create a cascading Dropdown between the AddressComboBox and the JobNumberComboBox each other?

Could you please share a bit more about the data source used in your app?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Address ComboBox to following:

If(
    IsBlank(JobNumberComboBox.Selected.Distinct),
    Distinct(DataSource, Address),
    Distinct(Filter(DataSource, JobNumber = JobNumberComboBox.Selected.Result), Address)
)

set the OnChange property of the Address ComboBox to following:

Set(SelectedAddressValue, AddressComboBox.Selected.Result)

 

Set the Items property of the JobNumber ComboBox to following:

If(
    IsBlank(SelectedAddressValue),
    Distinct(DataSource, JobNumber),
    Distinct(Filter(DataSource, Address = SelectedAddressValue), JobNumber)
)

Please consider take a try with above solution, check if the issue is solved.

Note: The Address, JobNumber are both columns in your data source, which you want to display within the ComboBox.

 

Best regards,

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

View solution in original post

8 REPLIES 8
Super User
Super User

Re: How to make two combo box search to display the content and vice versa.

You'll need to use different filters in your Items property of the gallery which displays your results.  Which filter gets used will be determined by which combo box is non-blank, something like:

If(!IsBlank(cbAddress.Selected.Text), 
Filter(dataSource, addressColumn = cbAddress.Selected.Text), 
!IsBlank(cbJobNumber.Selected.Text), 
Filter(dataSource, jobNumberColumn = cbJobNumber.Selected.Text),
Notify("Either JobNumber or Address is required", Error))

so if something was selected in the address combo box, you match on it.  If it is blank, then check to see if there was a job number and match on that.  If both were blank, give the user an error and tell them they have to use one or the other, or alternatively, display all records, unfiltered by either job number or address.

 

 

 

 

patty789
Level: Powered On

Re: How to make two combo box search to display the content and vice versa.

@LRVinNC  Thank you for your response howerver i am getting an error. When i am putting this formula in the items property of my data table i get this. Pic 19.JPG

Super User
Super User

Re: How to make two combo box search to display the content and vice versa.

@patty789 Take off the notify portion, leaving the final closing parenthesis.  I double checked and unfortunately, it appears you can't see the notify there like I thought you could.  If that doesn't resolve the error, let me know exactly what the error message you get says.

patty789
Level: Powered On

Re: How to make two combo box search to display the content and vice versa.

@LRVinNC i did took out the Notify and i also notice that there was another If missing so i added it and it worked. I do have another question in relates to this. The two combo boxes that i have Address and Job Number, i need to select either or. Expected: If an Address is slected the Job number updates to reflect the job number of the address. If a job number is selected the address updates to reflect the address of the job number. Can this be possible?

Super User
Super User

Re: How to make two combo box search to display the content and vice versa.

Ah... I misunderstood your intent.  I believe THIS is what you are trying to accomplish (although not the way you planned to accomplish it).  

 

I can use just ONE combobox to accomplish this.  In the combobox I can enter EITHER an address or a job number. Both are displayed in the dropdown.  (A1, A2, A3 represent job numbers in this example).

PAC1.png

If I enter any portion of the address, the list is filtered to show just my choices with that address and the available job numbers.  Once I select one of these, I could then open the detail record.  
If I enter any portion of the job number, the list is filtered to show just the choice(s) with the job number and where that job is located. 

PAC2.png

Here's how it's done.

 

PAC3.png

 

Shane Young (@shanescows) has an excellent video on this topic.  

 

I hope this better matches what you are trying to accomplish.

Community Support Team
Community Support Team

Re: How to make two combo box search to display the content and vice versa.

Hi @patty789 ,

Do you want to create a cascading Dropdown between the AddressComboBox and the JobNumberComboBox each other?

Could you please share a bit more about the data source used in your app?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Address ComboBox to following:

If(
    IsBlank(JobNumberComboBox.Selected.Distinct),
    Distinct(DataSource, Address),
    Distinct(Filter(DataSource, JobNumber = JobNumberComboBox.Selected.Result), Address)
)

set the OnChange property of the Address ComboBox to following:

Set(SelectedAddressValue, AddressComboBox.Selected.Result)

 

Set the Items property of the JobNumber ComboBox to following:

If(
    IsBlank(SelectedAddressValue),
    Distinct(DataSource, JobNumber),
    Distinct(Filter(DataSource, Address = SelectedAddressValue), JobNumber)
)

Please consider take a try with above solution, check if the issue is solved.

Note: The Address, JobNumber are both columns in your data source, which you want to display within the ComboBox.

 

Best regards,

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

View solution in original post

patty789
Level: Powered On

Re: How to make two combo box search to display the content and vice versa.

@v-xida-msft the data source is a Sharepoint list

patty789
Level: Powered On

Re: How to make two combo box search to display the content and vice versa.

@v-xida-msft This was exactly what i need it. Thank you

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,825)