List Manager Forum

How to remove duplicate entries from Option List

User liam.baker 2018-03-08 13:56:42

Hello,

First of all, thank you for your support so far.

I have a query regarding the optionlist list. I currently have a field which populates its data from another list using the following SQL code:

select value,value from #__listmanager_values where idfield=1

My problem is, as the original list builds up I have multiple duplicate entries in idfield=1. This is causing the optionlist to auto populate with all of the items (including the duplicate ones). Is there a way to strip out the duplicates so only unique fields are loaded in the optionlist?

Cheers

Edited by liam.baker - 08.03.2018 13:57

Moonsoft support 2018-03-08 17:14:46

Hello,
you can try to configure using a 'select distinct' or 'group by' at your sql in order to discard duplicates. Here we share the official docs so you can check the syntax:

https://dev.mysql.com/doc/refman/5.7/en/distinct-optimization.html

Regards

...
List Manager

Build different lists for your site

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!