3

I have a view set up to display the content of groups but it only works for viewing manual group membership, not smart groups. (I have the form set to require input rather than the basic form style.) I'm wondering if there is a way to display smart group membership in views or, because of the nature of smart groups, this is just not possible.

I'm in Drupal 7, CiviCRM 5.27.7, Views 7.x-3.23 and CiviEntity 7.x-2.2

(Use case: I'd like to have a form where users can quickly pull up the membership of a group set to be used in a bulk mailing. The users could then review membership. While yes, this can be done in advanced search we were looking at a more Drupal style report where we can also easily display specific columns of information.)

2 Answers 2

1

We wrote and used this a few years back but haven't had cause to try it recently - not sure if it offers what you want https://github.com/fuzionnz/civicrm_views_smartgroup

2
  • This does offer what I need, it totally works! (I did have to remember to add the newly created table in my settings file, it does not appear in the list on the Views Integration settings screen but it was two seconds of research to see I needed to add _civicrm_group_contact_union as another table)
    – RayWright
    Commented Mar 4, 2021 at 17:31
  • 1
    Glad it is helping you. adding the table is only necessary for those with separate databases
    – petednz - fuzion
    Commented Mar 4, 2021 at 18:22
1

You can join to any CiviCRM table with the Views CiviCRM Expose Tables module, so you can join to civicrm_group_contact_cache.

I'm not savvy enough about smart groups to know when this is reliable - this table gets destroyed and regenerated on a regular basis, and may come up empty sometimes. However, since this is for internal use, you could have some way to guarantee that the cache is full (e.g. by regenerating it as part of the user's workflow).

Another option to consider is Search Kit, if you can upgrade to newer versions of CiviCRM. It's very Views-like, and can give you a configurable set of columns.

1
  • We will be updating to the next ESR in March (5.35) - I will definitely be testing this out it looks amazing for empowering users to report in civi.
    – RayWright
    Commented Feb 16, 2021 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.