• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

How to eliminate duplicate data in CDD ?

molcomp

Member
Hi,

I tried several options but I either get an error or all the data are not displayed from the dropdown menu.

I have a CDD element in a table overlapping with following concat
(SELECT activity_name FROM activities WHERE id = {thistable}.activity_name)

{thistable} (intemgroup1 table name) is a relational table containing IDs of the other tables.
Project Activities Subactivities
1 1 1
1 1 2
2 1 1
etc

So in the dropdown list I get all the data related based on the watch field which is project. so I get the following dropdown:
Project 1

Activities dropdown list 1,1,2,2,2,2,3,3,3,3
(with the concat in the dropdown list names are displayed not the ids)

I want to display only one value of the activity not all the options.

The last thing I tried is below but it displays empty dropdown list under activities.
I must be missing something and if anyone had similar issue I appreciate your help.

In where clause under CDD element:

(SELECT DISTINCT activity_name from intemgroup1)

Thanks
Alex
 
I don't understand your setup.
A table used in Fabrik needs a unique id (PK) column (you can't use e.g. composite PKs).
DD and CDD elements are storing such a PK in the database.
If you get identical activity_names in your dropdown something is not unique.
 
Hello troester

Thank you for your help. Its all good its been a while since i have used fabrik many years ago :). I resolved the duplicate records using the following query:

->select(array('DISTINCT intemgroup1.id', 'activities.activity_name'))
->from('intemgroup1', 'activities')

I have another problem though hopefully I will resolve it over the wknd.

Thank you again
Alex
 

Members online

No members online now.
Back
Top