cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
swan_soup
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
tommyly
Responsive Resident
Responsive Resident

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
TimRohr
Solution Sage
Solution Sage

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

tommyly
Responsive Resident
Responsive Resident

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

Anonymous
Not applicable

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

 

@Anonymous

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,782)