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

Combine 3 Table in 1 DropDown Box

Dear All, 

I want to do a drop down box, but I have 3 tables which is Data1, Data2 and Data3.

Each of them have same colum name. I seperate the data due to i have and excess data ( about 5000 items), 

so I have to seperate into 3 Tables. 

How to combine all 3 Tables into 1 dropdown box?

Any guidline?

 

Best regards,

Prem

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Combine 3 Table in 1 DropDown Box

Hi @Premwong13 ,

Do the Table1, Table2 and Table3 have same column names?

Do you want to merge the Table1, Table2 and Table3 into a single one table?

Further, do you want to filter the merged table records based on the two Dropdown/ComboBox selected values?

 

If the Table1, Table2 and Table3 have same column names, and you want to merge them into to a Single one table, please consider take a try with the following workaround:

Set the OnStart property of the App control to following (the following formula would be executed when the OnStart property is fired😞

ClearCollect(MergedCollection, Table1, Table2, Table3)

Then you could set the Items property of the Gallery to following:

Filter(
         MergedCollection,
         If(
            IsBlank(LocationDropdownBox.Selected.Result) || LocationDropdownBox.Selected.Result = "Select All",
true,
LocationColumn = LocationDropdownBox.Selected.Result ),
If(
IsBlank(CategoryDropdownBox.Selected.Result) || CategoryDropdownBox.Selected.Result = "Select All",
true,
CategoryColumn = CategoryDropdownBox.Selected.Result
) )

Please consider take a try with above solution, then re-load your app (fire the OnStart property of the App control), check if the issue is solved.

 

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

5 REPLIES 5
Dual Super User
Dual Super User

Re: Combine 3 Table in 1 DropDown Box

@Premwong13 

 

One thing, I would suggest is to use a combobox instead of dropdown because a dropdown control has a limitation to only hold a limited number of entries(around 500). 
 
Now, if you want to combine the table returned values, you can collect a local collection based on three data sources and use this collection throughout your app.
 
Expression: ClearCollect(ComboBoxValues,Data1);Collect(ComboBoxValues,Data2);Collect(ComboBoxValues,Data3)
 
Now on the items property of a combobox control, add ComboBoxValues to see the values.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Premwong13
Level: Powered On

Re: Combine 3 Table in 1 DropDown Box

Dear @yashag2255 ,

Where should I apply this code on?

ClearCollect(ComboBoxValues,Data1);Collect(ComboBoxValues,Data2);Collect(ComboBoxValues,Data3)

OnVisible Gallery Screen ? 

 

Best Regards

Premwong13
Level: Powered On

Re: Combine 3 Table in 1 DropDown Box

Dear @yashag2255 ,

 

Mine have 2 Dropdown/Combo,will change layer, boxes, in order to show the match data on Gallery.

The 2 selected choices much match to Table1,2and3

Screen Shot 2562-07-03 at 10.40.33.png

Dual Super User
Dual Super User

Re: Combine 3 Table in 1 DropDown Box

Hi @Premwong13 

 

Yes the code can be placed either on "OnVisible" property of your page or at the OnStart property of your app.
 
In case you want to populate dropdown with the values from the collection (From Data1,Data2 and Data3), you can use the following expressions:
 
Distinct(ComboBoxValues,Location)
Distinct(ComboBoxValues,Category)
 
I am assuming that Location/Category are attributes in your data sources.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Community Support Team
Community Support Team

Re: Combine 3 Table in 1 DropDown Box

Hi @Premwong13 ,

Do the Table1, Table2 and Table3 have same column names?

Do you want to merge the Table1, Table2 and Table3 into a single one table?

Further, do you want to filter the merged table records based on the two Dropdown/ComboBox selected values?

 

If the Table1, Table2 and Table3 have same column names, and you want to merge them into to a Single one table, please consider take a try with the following workaround:

Set the OnStart property of the App control to following (the following formula would be executed when the OnStart property is fired😞

ClearCollect(MergedCollection, Table1, Table2, Table3)

Then you could set the Items property of the Gallery to following:

Filter(
         MergedCollection,
         If(
            IsBlank(LocationDropdownBox.Selected.Result) || LocationDropdownBox.Selected.Result = "Select All",
true,
LocationColumn = LocationDropdownBox.Selected.Result ),
If(
IsBlank(CategoryDropdownBox.Selected.Result) || CategoryDropdownBox.Selected.Result = "Select All",
true,
CategoryColumn = CategoryDropdownBox.Selected.Result
) )

Please consider take a try with above solution, then re-load your app (fire the OnStart property of the App control), check if the issue is solved.

 

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

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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