4

Webform_CiviCRM integration enables me to add contacts who submit a form to a Civi group. What I'd like to do is to remove them from another group at the same time, as part of a pipeline process. Drupal Rules module offers 'Remove contact from CiviCRM group' as an action, but I can't work out how to "select data of the type Contact" which seems to be what Rules is looking for in order to enable this action. How can I create a rule that removes a contact form a group based on the matched Drupal user submitting a webform (or perhaps based on the fact that the webform adds the contact to a group)?

4

Graham, you can do this with CiviRules? Trigger should be when contact is added to group, condition specifies what group and the related action is to remove contact from group.

  • Thanks @ErikH, I'll certainly check it out, and will accept your answer. – Graham Nov 11 '15 at 9:16
  • 2
    Graham, we are thinking about a new extension: webform_civirules which would enable integration between Drupal webforms and CiviRules. So it would be possible to do thinks like 'if this webform is submitted and this field has the value xxx do this'. Think that would be useful and let me know if you can get funding :-) – ErikH - CiviCooP Nov 11 '15 at 9:56
3

Graham made a feature request and we got this feature in the CiviCRM Entity module, for doing this with Drupal Rules

Just added a rules action "Unassign contact from group" to the dev release of CiviCRM 2 days ago, along with "Assign contact to group"

This will be in beta7 when it gets released in a couple of weeks, after some new PRs get tested and merged in.

If you have the user object available in the Rule you can use the "Load or Create CiviCRM Contact" action, then the "Unassign Contact from Group" action to remove the contact from a group.

This issue had some basic instructions: https://www.drupal.org/node/2854256

Get the dev version here: https://www.drupal.org/project/civicrm_entity/releases/7.x-2.x-dev

or beta7 or above when it comes out...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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