Answers.Body: <p>There was a blog <a href="https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and" rel="nofollow noreferrer">here</a> about creating Drupal users by adding a civicrm tag (as one option for achieving this) and triggering a Drupal Rule from that which you may find it useful.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-12T03:02:36.533Z
Answers.Text: The rules in this blog post no longer work with the latest version of CiviCRM Entity unfortunately.
Answers.UserDisplayName: richardsplayground
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-12T03:15:32.497Z
Answers.Text: This post provides a rule that does work with the latest version of CiviCRM entity: https://civicrm.stackexchange.com/questions/16508/setting-up-rule-to-link-civicrm-contact-with-drupal-7-account
Answers.UserDisplayName: richardsplayground
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-30T18:45:46.563Z
Answers.LastActivityDate: 2016-11-07T19:20:55.567Z
Answers.LastEditDate: 2016-11-07T19:20:55.567Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>There's a working recipe on <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Creating+a+Drupal+user+for+every+CiviCRM+contact" rel="nofollow">this CiviCRM wiki page</a>.  There's also an excellent discussion on the old forums <a href="https://forum.civicrm.org/index.php?topic=32677.0" rel="nofollow">here</a>.  In particular, I'd make sure you have all the modules named on that second link installed.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-29T00:57:53.570Z
Answers.LastActivityDate: 2016-10-29T00:57:53.570Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Was trying to set up a rule to create drupal user records linked to CiviCRM records that do not have them,
  The rule is this:</p>
  
  <p>EVENT
  CiviCRM Contact has been created<br>
  Contact has been updated    </p>
  
  <p>Conditions
   NOT Drupal User Account can be created for user (this condition creates the user)
  Parameter: CiviCRM Contact: [civicrm-contact:civi-user..., Activate Account: true, Send account notification email: true, Instant signin: false</p>
  
  <p>Actions
  Create or Load Linked Drupal User Account
  Parameter: CiviCRM Contact: [civicrm_contact], Activate Account: true, Send account notification email: true
  Provides variables: Created or Loaded Drupal User (civicrm_user)</p>
  
  <p>Show a message on the site
  Parameter: Message: Drupal User Linked or...</p>
  
  <p>Unfortunately we don't seem to be able to trigger the rule by updating a contact, we just seem to get this error in the watchdog:</p>
  
  <p>MESSAGE Unable to get variable civicrm_contact, it is not defined.</p>
  
  <p>Does anyone know how to get this working? Thanks!</p>
  
Tags: <drupal><user-account><rules>
Title: Rule will not create drupal user record for CiviCRM contact
ThreadText: # Rule will not create drupal user record for CiviCRM contact
  
  (Asked by: username_0 on 2016-10-28)
  
  Was trying to set up a rule to create drupal user records linked to CiviCRM records that do not have them,
  The rule is this:
  
  EVENT
  CiviCRM Contact has been created  
  Contact has been updated
  
  Conditions
  NOT Drupal User Account can be created for user (this condition creates the user)
  Parameter: CiviCRM Contact: [civicrm-contact:civi-user..., Activate Account: true, Send account notification email: true, Instant signin: false
  
  Actions
  Create or Load Linked Drupal User Account
  Parameter: CiviCRM Contact: [civicrm\_contact], Activate Account: true, Send account notification email: true
  Provides variables: Created or Loaded Drupal User (civicrm\_user)
  
  Show a message on the site
  Parameter: Message: Drupal User Linked or...
  
  Unfortunately we don't seem to be able to trigger the rule by updating a contact, we just seem to get this error in the watchdog:
  
  MESSAGE Unable to get variable civicrm\_contact, it is not defined.
  
  Does anyone know how to get this working? Thanks!
  
  **Tags:** drupal, user-account, rules
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-10-30. Score: 1 | Accepted answer
  
  There was a blog [here](https://civicrm.org/blog/username_1/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and) about creating Drupal users by adding a civicrm tag (as one option for achieving this) and triggering a Drupal Rule from that which you may find it useful.
  
  > **Comments:**
  > **username_2**: The rules in this blog post no longer work with the latest version of CiviCRM Entity unfortunately.  
  > **username_2**: This post provides a rule that does work with the latest version of CiviCRM entity: https://civicrm.stackexchange.com/questions/16508/setting-up-rule-to-link-civicrm-contact-with-drupal-7-account  
  
  ---
  
  ### Answer by username_3 on 2016-10-29. Score: 3
  
  There's a working recipe on [this CiviCRM wiki page](https://wiki.civicrm.org/confluence/display/CRMDOC/Creating+a+Drupal+user+for+every+CiviCRM+contact). There's also an excellent discussion on the old forums [here](https://forum.civicrm.org/index.php?topic=32677.0). In particular, I'd make sure you have all the modules named on that second link installed.
  
  
  ---
  
  