Answers.Body: <p>The blog <a href="https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and" rel="nofollow">here</a>, which may have been the source of Laryn's solution, also contained some exported Rules that might still work out of the box. There are variations depending on whether you want to log the person in immediately the form is submitted (which we often do when the webform is the second in a chain of webforms)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-12T00:06:26.127Z
Answers.Text: Yes, that was it -- I just updated to give credit to you. And thanks, it is a brilliant strategy!
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-12T02:21:01.803Z
Answers.Text: cool - will up your answer since it is the more complete.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-11T20:59:41.960Z
Answers.LastActivityDate: 2016-05-11T20:59:41.960Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <h1>Backdrop</h1>
  <p>The simplest way would be to use the <a href="https://github.com/backdrop-contrib/webform_registration" rel="nofollow noreferrer">Webform Registration</a> module, which has been tested to ensure it works with CiviCRM email fields.</p>
  <h1>Drupal</h1>
  <p>This conversation came up on the <a href="https://chat.civicrm.org" rel="nofollow noreferrer">CiviCRM chat</a>. I have done this for a site previously -- following instructions from <a href="https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and" rel="nofollow noreferrer">@petednz's blog post here</a>. <em>(Note that blog post also has some exported Rules that you can download to start with and maybe save some time).</em></p>
  <p>But if you want to start from scratch, here's what you need:</p>
  <ul>
  <li>Webform CiviCRM</li>
  <li>Rules</li>
  <li>CiviCRM Entity</li>
  </ul>
  <hr />
  <ol>
  <li>Create a tag within CiviCRM, something like &quot;Create Drupal User&quot;.</li>
  <li>Set up the form, enable CiviCRM processing, and add a contact in the CiviCRM tab, customizing as you see fit.</li>
  <li>On the &quot;Tags and Groups&quot; section for this contact, select the tag you created in #1. <a href="https://i.sstatic.net/pMKnH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pMKnH.png" alt="Tags and groups" /></a></li>
  <li>Go to the Rules page (Configuration &gt; Workflow &gt; Rules) and click &quot;Add New Rule&quot;</li>
  <li>Name the rule and choose the <strong>React on Event</strong> as &quot;CiviCRM Entity Tag has been created&quot; <a href="https://i.sstatic.net/HDy1x.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HDy1x.png" alt="React on event" /></a></li>
  <li>As for <strong>Conditions</strong>, we first want to make sure there is no existing Drupal user for this contact, so we use the &quot;Drupal User Account exists for Contact&quot; and negate it (data selector value will be something like <code>civicrm-entity-tag:entity-id-contact</code>).</li>
  <li>Then we do a data comparison on <code>civicrm-entity-tag:entity-table</code> to make sure that it is &quot;civicrm_contact&quot; (to be sure we are updating the right entity)</li>
  <li>And as the final condition, another data comparison to make sure the tag that was created is the correct tag which should result in a Drupal user being created. Using the numeric tag ID from the tag you created in #1 (you can find this in the second column of the CiviCRM &quot;Manage tags&quot; section), we can compare to make sure that <code>civicrm-entity-tag:tag-id</code> equals this numeric ID. <a href="https://i.sstatic.net/7ZtiX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7ZtiX.png" alt="Conditions" /></a></li>
  <li>Finally, under <strong>Actions</strong>, we can use the &quot;Create Linked Drupal User Account&quot; action on the data selector <code>civicrm-entity-tag:entity-id-contact</code>. There are a few other options within here which you can set related to whether to activate/auto-sign in/send notification email as well.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-23T19:15:31.290Z
Answers.Text: Tony - I converted your 'Answer' to a Comment (stackexchange is Q&A, not a forum). If you can clarify which steps of Laryn's you tried and what version of CiviCRM Entity you have enabled
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-24T20:08:06.727Z
Answers.Text: @maynardsmith Do you have the CiviCRM Entity module installed and activated? https://www.drupal.org/project/civicrm_entity
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2016-05-11T18:52:53.403Z
Answers.LastActivityDate: 2021-01-15T15:29:50.610Z
Answers.LastEditDate: 2021-01-15T15:29:50.610Z
Answers.UserDisplayName: Laryn
Body: <p>When someone submits a CiviCRM-enabled Webform, can I create a user for them automatically in Drupal or Backdrop?</p>
  
Tags: <drupal><webform-civicrm><backdrop>
Title: How can I create a user automatically when someone submits a CiviCRM-Webform?
ThreadText: # How can I create a user automatically when someone submits a CiviCRM-Webform?
  
  (Asked by: username_0 on 2016-05-11)
  
  When someone submits a CiviCRM-enabled Webform, can I create a user for them automatically in Drupal or Backdrop?
  
  **Tags:** drupal, webform-civicrm, backdrop
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-05-11. Score: 13 | Accepted answer
  
  # Backdrop
  
  The simplest way would be to use the [Webform Registration](https://github.com/backdrop-contrib/webform_registration) module, which has been tested to ensure it works with CiviCRM email fields.
  
  # Drupal
  
  This conversation came up on the [CiviCRM chat](https://chat.civicrm.org). I have done this for a site previously -- following instructions from [@petednz's blog post here](https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and). *(Note that blog post also has some exported Rules that you can download to start with and maybe save some time).*
  
  But if you want to start from scratch, here's what you need:
  
  * Webform CiviCRM
  * Rules
  * CiviCRM Entity
  
  ---
  
  1. Create a tag within CiviCRM, something like "Create Drupal User".
  2. Set up the form, enable CiviCRM processing, and add a contact in the CiviCRM tab, customizing as you see fit.
  3. On the "Tags and Groups" section for this contact, select the tag you created in #1. [![Tags and groups](https://i.sstatic.net/pMKnH.png)](https://i.sstatic.net/pMKnH.png)
  4. Go to the Rules page (Configuration > Workflow > Rules) and click "Add New Rule"
  5. Name the rule and choose the **React on Event** as "CiviCRM Entity Tag has been created" [![React on event](https://i.sstatic.net/HDy1x.png)](https://i.sstatic.net/HDy1x.png)
  6. As for **Conditions**, we first want to make sure there is no existing Drupal user for this contact, so we use the "Drupal User Account exists for Contact" and negate it (data selector value will be something like `civicrm-entity-tag:entity-id-contact`).
  7. Then we do a data comparison on `civicrm-entity-tag:entity-table` to make sure that it is "civicrm\_contact" (to be sure we are updating the right entity)
  8. And as the final condition, another data comparison to make sure the tag that was created is the correct tag which should result in a Drupal user being created. Using the numeric tag ID from the tag you created in #1 (you can find this in the second column of the CiviCRM "Manage tags" section), we can compare to make sure that `civicrm-entity-tag:tag-id` equals this numeric ID. [![Conditions](https://i.sstatic.net/7ZtiX.png)](https://i.sstatic.net/7ZtiX.png)
  9. Finally, under **Actions**, we can use the "Create Linked Drupal User Account" action on the data selector `civicrm-entity-tag:entity-id-contact`. There are a few other options within here which you can set related to whether to activate/auto-sign in/send notification email as well.
  
  > **Comments:**
  > **username_1**: Tony - I converted your 'Answer' to a Comment (stackexchange is Q&A, not a forum). If you can clarify which steps of username_0's you tried and what version of CiviCRM Entity you have enabled  
  > **username_0**: @maynardsmith Do you have the CiviCRM Entity module installed and activated? https://www.drupal.org/project/civicrm_entity  
  
  ---
  
  ### Answer by username_1 on 2016-05-11. Score: 3
  
  The blog [here](https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and), which may have been the source of username_0's solution, also contained some exported Rules that might still work out of the box. There are variations depending on whether you want to log the person in immediately the form is submitted (which we often do when the webform is the second in a chain of webforms)
  
  > **Comments:**
  > **username_0**: Yes, that was it -- I just updated to give credit to you. And thanks, it is a brilliant strategy!  
  > **username_1**: cool - will up your answer since it is the more complete.  
  
  ---
  
  