Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: None
-
Fix Version/s: 1.4
-
Component/s: None
-
Labels:None
Description
Users have requested that Tags and Groups be available in Contact Export (this would be via the Export - Select Fields, not the default primary fields). However, we don't want to have to nest queries to get the export rows.
It looks to me like we can use the GROUP_CONCAT function to generate a list of tag names and group names as SELECT columns in the existing (single) export query. According the MySQL manual this function is available in 3.2 + so we should be able to use it . If we can integrate this mechanism into the existing export query - that would solve the problem.
Here's example of SQL for the tag names. To try it out - replace the cid w/ one on your sandbox that has some tags:
SELECT display_name,
GROUP_CONCAT(civicrm_tag.name) AS tags
FROM civicrm_contact, civicrm_entity_tag, civicrm_tag
WHERE civicrm_contact.id = 101 AND
civicrm_contact.id = civicrm_entity_tag.entity_id AND
civicrm_entity_tag.tag_id = civicrm_tag.id
GROUP BY display_name
display_name tags
Dave Greenberg Major Donor,Volunteer