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

Combine 2 data sources with one searchbox

Hello!

 

Can somebody please help me with the following, i dont know if it is possible and how to do this. The several post related to this subject didn't helped me

 

I have 2 data sources with the same columns, both sharepoint a list. Is it possible to make one text searchbox and search the 2 different data sources at once and combine the results in one view?

 

On this moment this formula works fine for the 2 separate sources;

SortByColumns(Filter('Machineseeker_1';StartsWith(Fabrikant;TextSearchBox2.Text));"Type1";If(SortDescending1;Descending;Ascending))

 

I just started so a little bit detailed help is appreciated

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Combine 2 data sources with one searchbox

Hi @MvB,

Do your two SP lists have same data structure?

If your two SP lists have same data structure, I think the Collection could achieve your needs.

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

Set the OnVisible property of the first screen of your app to following:

ClearCollect(RecordsCollection; 'YourSPList1'; 'YourSPList2')  /* <-- Combine your two SP lists into single one Collection */

On your side, it may be:

ClearCollect(RecordsCollection; 'Machineseeker_1'; 'Machineseeker_2')

Set the Items property of the Gallery to following:

SortByColumns(
Filter(RecordsCollection; StartsWith(Fabrikant; TextSearchBox2.Text));
"Type1";
If(SortDescending1;Descending;Ascending)
)

then use the RecordsCollection as data source within your app instead of the separated SP list.

 

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.
2 REPLIES 2
Super User
Super User

Re: Combine 2 data sources with one searchbox

Hi @MvB,

You cannot have two separate datasources for one gallery.  However, if your datasources have exactly the same column names and types, you can combine them using the Collect() function. and search the resulting collection. There may be a problem with duplicates in the ID fields.  You may also want to shape the two collections using AddColumns, DropColumns, RenameColumns, and ShowColumns functions before combining them. 

Collect(colMachineseeker, Machineseeker_1); Collect(colMachineseeker, Machineseeker_2)

Then use

SortByColumns(Filter(colMachineseeker,;StartsWith(Fabrikant;TextSearchBox2.Text));"Type1";If(SortDescending1;Descending;Ascending))

For your Gallery items property.  

Community Support Team
Community Support Team

Re: Combine 2 data sources with one searchbox

Hi @MvB,

Do your two SP lists have same data structure?

If your two SP lists have same data structure, I think the Collection could achieve your needs.

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

Set the OnVisible property of the first screen of your app to following:

ClearCollect(RecordsCollection; 'YourSPList1'; 'YourSPList2')  /* <-- Combine your two SP lists into single one Collection */

On your side, it may be:

ClearCollect(RecordsCollection; 'Machineseeker_1'; 'Machineseeker_2')

Set the Items property of the Gallery to following:

SortByColumns(
Filter(RecordsCollection; StartsWith(Fabrikant; TextSearchBox2.Text));
"Type1";
If(SortDescending1;Descending;Ascending)
)

then use the RecordsCollection as data source within your app instead of the separated SP list.

 

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.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 225 members 4,604 guests
Please welcome our newest community members: