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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • real dynamic groups
Pages: [1]

Author Topic: real dynamic groups  (Read 4780 times)

jpoesen

  • Guest
real dynamic groups
May 01, 2007, 09:47:41 am
Hi. I was wondering if there's a way to define your recipient group based on an advanced search.

Example: I'd like to send a newsletter to all my contacts in France. I don't want to create a "France" group because I already have a "Country" field and I don't want to make and maintain a group for every country in the world. And maybe tomorrow I want to send a newsletter to all male contacts over 40 who are volunteers and live in London.

Ideally, you should have the ability to save a complex search as a "search agent" and use the query over and over again.

your thoughts?
Joeri
« Last Edit: May 01, 2007, 10:02:15 am by jpoesen »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: real dynamic groups
May 01, 2007, 10:17:49 am

I assume u mean tokenized groups? Where your advanced search is a function of a few variables (country in the below case). Though not sure how u can handle "injecting new criteria" (male cantacts over 40)

I think tokenized groups are quite important and needed to scale the system up nicely (for things like permissioning). Its on our TODO list but not for the next few releases.

If this is important to you/your org please consider donating a developer resource to implement it

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jpoesen

  • Guest
Re: real dynamic groups
May 01, 2007, 10:31:50 am
Hi Lobo

No I don't mean tokenized groups. I'm talking about building a complex query and then
1. saving that query so you don't have to build that same query again at a later time
2. using that query at any given time and using the result set as a sort on-the-fly created dynamic group you can use as recipient group for civimail

I think this feature is essential if you want to have a flexible way to contact your contacts without creating dozens of groups.

This is important to me and I don't mind donating code to achieve this result but I don't want to double work, I don't want to do unnecessary work (this functionality might already be present) and I'm relatively new at drupal development.

thanks
Joeri

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: real dynamic groups
May 01, 2007, 10:37:20 am

There has been support for that since v1.0 :)

We call it smart groups, where u save your query using the actions dropdown after u do a search

I assume u filed CRM-1878. The saved query ignores the records selected. IT only saves your query criteria (i.e. male contacts over 40 and country = US)

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jpoesen

  • Guest
Re: real dynamic groups
May 01, 2007, 01:30:50 pm
But a smart group does the same thing a normal group does, only you can create a smart group based on a set of contacts so they immediately belong to the group. A smart group behaves just as a normal group and has a real many-to-many relation with contacts.

I'm not looking for a normal group, I'm looking for something like an SQL view. I need to be able to create a view (or a dynamic group or whatever you want to call it) like "select * from contacts where city = 'London'" and at any given time run that query and use the result set as group of recipients for my mailings. So

Since you can actually add contacts to a smart group, it does not seem that smart groups do what I need. I hope I'm making sense to you...

About CRM-1878: yes, when you create a smart group, record selection is ignored when you indicate "selected records only".

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: real dynamic groups
May 01, 2007, 01:43:54 pm

smart groups are an sql view. (i.e. select * from contacts where country = 'US' etc). it does not store the selected contacts but stores the query conditions

i.e. the results it returns changes. Please play and experiment with it a bit. We dont make it clear in the interface that we ignore any/all the selected contacts (i.e. the selection of the contacts has no effect)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jpoesen

  • Guest
Re: real dynamic groups
May 01, 2007, 11:38:58 pm
Aha, if smart groups actually are views then it makes sense that the selected contacts are ignored.
I actually played around with the smart groups but obviously not enough to discover they actually are exactly what I need.

So if you manually add a contact to a smart group, you'd get a view like
select * from contacts where country = 'US' and (id=3 or id=5 and id=6)' ?

Maybe it would be a good idea to allows show groups and smart groups separately in the interface (i.e. whenn adding/editing a contact). This would keep the list of real groups clean and usable while allowing you to create a big list of smart groups that don't interfere with the normal groups in the gui...

Thanks for clearing these things up, lobo
J.

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: real dynamic groups
May 06, 2007, 07:49:51 pm
I actually get messed up with the groups/smart groups issue at times. If you manually put someone into a smart group that record will actually not show up when you use some methods of working with the smart groups. You really shouldn't be able to manually put records in, because they don't work 100% correctly when you do.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: real dynamic groups
May 06, 2007, 08:56:47 pm

Elin:

can u be more specific of the cases where we dont show ALL members of the smart group. That is definitely a bug :)

Being able to add exceptions to the query is quite important for quite a few cases based on our past experience

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • real dynamic groups

This forum was archived on 2017-11-26.