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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • how to create smart group based on organization attributes of related contacts
Pages: [1]

Author Topic: how to create smart group based on organization attributes of related contacts  (Read 751 times)

daveatkins

  • I post occasionally
  • **
  • Posts: 68
  • Karma: 2
  • CiviCRM version: 4.1.6
  • CMS version: Drupal 6.28
  • MySQL version: 5.1.41
  • PHP version: 5.2.10
how to create smart group based on organization attributes of related contacts
October 12, 2011, 12:01:57 pm
I need a smart group consisting of Canadian users who are employees of Government Organizations. To find these contacts, I would search for Individuals who have Country = Canada and whose employer is of type "Government Organization" This "type" field is a custom field for the organization.

Is this possible? I find no results; if I search for the organizations, I find them, but I need the contacts, not the organizations.

This seems like a simple query...find the organizations, then all the contacts who are employees of those organizations. What am I missing?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: how to create smart group based on organization attributes of related contacts
October 12, 2011, 01:23:13 pm
At the top right of Adv Search there is now the option to specify the type of output you want, including Relationships. Does that help?

Otherwise I would think that something like
Contact Type = Individual
Relationship = Employee of
Group = (make a Smart Group based on that Custom Field you have)

Alternatively use a Tag instead of your Custom Field if you want to avoid having a Smart Group that is dependent on another Smart Group
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: how to create smart group based on organization attributes of related contacts
October 12, 2011, 02:40:46 pm
When 4.1 comes out, there will be a new feature within Advanced Search which will make this easier. You'll be able to limit the results to relationships (e.g. employee of) where the target (e.g. employer) is in a specific group (in your case, Government Organizations).

http://issues.civicrm.org/jira/browse/CRM-8933

Thx for a great contribution from a community member - Andrew Harris!
Protect your investment in CiviCRM by  becoming a Member!

daveatkins

  • I post occasionally
  • **
  • Posts: 68
  • Karma: 2
  • CiviCRM version: 4.1.6
  • CMS version: Drupal 6.28
  • MySQL version: 5.1.41
  • PHP version: 5.2.10
Re: how to create smart group based on organization attributes of related contacts
October 13, 2011, 06:42:32 am
petednz, that sounds like a great solution. I did not know it was possible to "nest" smart groups in this way. It's basically a subquery. I'll try and see how this works.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • how to create smart group based on organization attributes of related contacts

This forum was archived on 2017-11-26.