cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gaborszollosy
Helper I
Helper I

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
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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,409)