CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • automated [?] smart group generation
Pages: [1]

Author Topic: automated [?] smart group generation  (Read 1203 times)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
automated [?] smart group generation
June 25, 2009, 09:05:04 am
I've got 107 riding assocations for the members of political party, their riding association is stored in a custom field that I populated via an import.

I've just manually created the first 5 smart groups based on the value in this field, and I'm thinking either there's a better way to do this, or an automated way to generate the smart groups [i want groups for both mailing list and acl functions]

It looks like each smart group is adding a new row to civicrm_group and I could write a little script to just add new rows based on the existing ones, but I wonder if i also need some new rows in other tables, or whether those would be auto-generated if they don't exist...

So: what rows in what tables are required for a new smart group? [i'm using the search builder method to generate the smart groups manually].

Or: is this a bad plan due to the limitations of smart groups - e.g. should i instead convert these to regular groups [and ditch my custom field]?

While i'm at it - i'll want to generate some regional groupings of these groups (e.g. riding 1-20 make up the first region, etc.) and it looks like I can manually do this with smart groups as well - any short cuts or other ideas about that?

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: automated [?] smart group generation
June 30, 2009, 05:35:46 pm
You could certainly use the API to write a script to do it with regular groups.

IIRC, the real magic of smart groups happens in the civicrm_saved_search table.
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • automated [?] smart group generation

This forum was archived on 2017-11-26.