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

2 Data Sources on 1 ComboBox

Hi all,

 

I currently have an issue where I need to be able to default a combobox item to match my current record in a gallery. Only issue is that my combobox items all have to come from a specific SharePoint list. Whereas the rest of my gallery is coming from a separate static table. 

My question is if I have to connect both the SharePoint and the static table to the combobox? 

Or is there some function I can use where my selected gallery item can recognize the data in its column and match with the same item on the SharePoint column?

 

Let me know if further explaining is needed. 

What I said makes sense in my head but might not make sense to anyone else reading Smiley Very Happy

Cheers!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

Re: 2 Data Sources on 1 ComboBox

You can refer to a field (or object) in your gallery by using ThisItem. For example let's say you have a gallery based on a SharePoint list with Address information called myAddressList.

 

Let's say from within the gallery's card, you have comboBox1 and you want the default value to equal the card's City. You would do something like this:

comoboBox1.Default = ThisItem.City

Let's say you have a comboBox2 that is not in the gallery card; instead, comboBox2 resides outside of the gallery. You would refer to the gallery's item like this:

comboBox2.Default = gallery1.Selected.City

The neat thing about gallery objects is that you can refer to objects that reside inside the cards. For example, this would output the currently selected item from comboBox:

gallery1.Selected.comboBox1.Selected.City

View solution in original post

3 REPLIES 3
Highlighted
Solution Sage
Solution Sage

Re: 2 Data Sources on 1 ComboBox

To filter a datasource down to a particular record as selected in another control, you would use the Filter() function in the Items property of a gallery (for instance), and reference the control.

 

Filter(myData, myField = myDropDown.Selected.myField)

 

On the other hand, to filter a combobox/dropdown to match a subset of items might be connected to an item selected in a Gallery, or to populate the Default item for that combobox/dropdown, then you will need to reference the gallery's Selected property, and get to the appropriate field

 

myGallery.Selected.myField

Highlighted
Responsive Resident
Responsive Resident

Re: 2 Data Sources on 1 ComboBox

You can refer to a field (or object) in your gallery by using ThisItem. For example let's say you have a gallery based on a SharePoint list with Address information called myAddressList.

 

Let's say from within the gallery's card, you have comboBox1 and you want the default value to equal the card's City. You would do something like this:

comoboBox1.Default = ThisItem.City

Let's say you have a comboBox2 that is not in the gallery card; instead, comboBox2 resides outside of the gallery. You would refer to the gallery's item like this:

comboBox2.Default = gallery1.Selected.City

The neat thing about gallery objects is that you can refer to objects that reside inside the cards. For example, this would output the currently selected item from comboBox:

gallery1.Selected.comboBox1.Selected.City

View solution in original post

Highlighted
Anonymous
Not applicable

Re: 2 Data Sources on 1 ComboBox

Thanks for your help with this thread @TimRohr and @tommyly!

 

@Anonymous

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

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