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

Searching in Gallery, without duplicates

Hello there!

 

I'm making a gallery that is searchable with a field, and the data source has multiple lines with the same company name.

Is there a way, where I can further filter out search results not to include duplicate company names?

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @gaborszollosy,

Have you solved your problem?

Do you want to exclude duplicate company records based on Search() function?

Could you please share a bit more about the scenario?

I assume that you want to filter gallery based on the search text firstly, and exclude the duplicate company named records, right?

I have a test on my side, please take a try as below.

Set the Items property of the Gallery as below:

GroupBy(Search(Product,TextInput21.Text,"Description"),"employees","Gemp")// Assume that the Description is your search fields, and the employees is the company name column in your scenario.

Set the Text property of the Label as below:

Concat(ThisItem.Gemp.Title,Title,",") // This represents the distinct values corresponding to Title column in reocrds of duplicate search fields and company names fields.
Concat(Distinct(Split(Concat(ThisItem.Gemp.Description,Description,","),","),Result),Result,",")// This represents the distinct values corresponding to the search fields

vqiaqimsft_0-1631844529875.png

Best Regards,
Qi

View solution in original post

3 REPLIES 3
zmansuri
Super User
Super User

Use distinct around the code:

Search(Distinct(DataSource,Company),SearchBox.Text,"SearchColumn")

v-qiaqi-msft
Community Support
Community Support

Hi @gaborszollosy,

Have you solved your problem?

Do you want to exclude duplicate company records based on Search() function?

Could you please share a bit more about the scenario?

I assume that you want to filter gallery based on the search text firstly, and exclude the duplicate company named records, right?

I have a test on my side, please take a try as below.

Set the Items property of the Gallery as below:

GroupBy(Search(Product,TextInput21.Text,"Description"),"employees","Gemp")// Assume that the Description is your search fields, and the employees is the company name column in your scenario.

Set the Text property of the Label as below:

Concat(ThisItem.Gemp.Title,Title,",") // This represents the distinct values corresponding to Title column in reocrds of duplicate search fields and company names fields.
Concat(Distinct(Split(Concat(ThisItem.Gemp.Description,Description,","),","),Result),Result,",")// This represents the distinct values corresponding to the search fields

vqiaqimsft_0-1631844529875.png

Best Regards,
Qi

View solution in original post

Thank you @zmansuri and @v-qiaqi-msft for both your help!

 

I appreciate your time and solution, @v-qiaqi-msft!! This is exactly what I needed for it to work.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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
Top Kudoed Authors
Users online (2,498)