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)?
2 Answers
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.– GrahamCommented Nov 11, 2015 at 9:16
-
2Graham, 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 :-) Commented Nov 11, 2015 at 9:56
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...