Answers.Body: <p>If they create a Drupal account is there already a duplicate before they fill the Webform? If so, you may be able to use a Profile on the Drupal account creation page that matches contacts to prevent duplicates there -- at which point the webform should function as expected.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-25T18:55:59.653Z
Answers.LastActivityDate: 2015-08-25T18:55:59.653Z
Answers.UserDisplayName: Laryn
Answers.Body: <p>The way we do it is that we have 2 webforms. </p>
  
  <p>The first form creates a civi-drupal linked user account. On this form we deactivate the existing user feature.
  We use the civicrm_rules integration module and set a rule to create a drupal user for civicrm contacts who have a certain tag. <a href="https://civicrm.org/blogs/petednz/creating-drupal-users-made-easy-single-or-multiple-contacts-civi-imports-and-webforms" rel="nofollow">See here</a> and we use the CiviGroup Roles Sync module to assign Drupal permissions.</p>
  
  <p>The second form includes the existing user but we set it to static and display name = yes. 
  in form settings we set it to only allow authenticated users. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-26T22:40:05.633Z
Answers.LastActivityDate: 2015-08-26T22:40:05.633Z
Answers.UserDisplayName: Yossi
Body: <p>I’m using Drupal 7.39, CiviCRM 4.6.7, and Webform CiviCRM Integration 7.x-4.12. I have a webform built whereas I’ve enabled the ‘Existing Contact’ field as I want the fields in the form to be filled out if the user has a CiviCRM contact record and those data are already entered.</p>
  
  <p>If the user already has a Drupal account and a corresponding CiviCRM contact then all works well. The user logs and and goes to the form, sees the existing information, changes what needs editing, submits, and the corresponding CiviCRM contact record is updated with the new information.</p>
  
  <p>The issue seems to be if there is a CiviCRM contact record and no associated Drupal account. If a user creates a new Drupal account then goes to the webform and submits it, a duplicate CiviCRM contact is created, the dedup rules are not used.</p>
  
  <p>I noticed that when choosing a ‘Matching Rule’ there is this information:</p>
  
  <blockquote>
    <p>Note: Matching rules are only used if the contact is not already selected via "Existing Contact" field.</p>
  </blockquote>
  
  <p>Is there a way around this? I need to have the form autopopulate if the Drupal user already has a CiviCRM contact record so they know what their existing information is and what might need to be corrected. But at the same time if they are creating a new Drupal account I want to avoid getting a lot of duplicate CiviCRM contacts created.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-25T18:52:30.547Z
Comments.Text: If they create a Drupal account is there already a duplicate before they fill the Webform? If so, you may be able to use a Profile on the Drupal account creation page that matches contacts to prevent duplicates there -- at which point the webform should function as expected.
Comments.UserDisplayName: Laryn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-25T18:54:12.993Z
Comments.Text: @Laryn I think this is the correct answer. Deduping should be performed on account creation.
Comments.UserDisplayName: Coleman
Tags: <webform-civicrm><duplicate-contacts>
Title: Webform CiviCRM Integration and duplicate contacts
ThreadText: # Webform CiviCRM Integration and duplicate contacts
  
  (Asked by: username_0 on 2015-08-25)
  
  I’m using Drupal 7.39, CiviCRM 4.6.7, and Webform CiviCRM Integration 7.x-4.12. I have a webform built whereas I’ve enabled the ‘Existing Contact’ field as I want the fields in the form to be filled out if the user has a CiviCRM contact record and those data are already entered.
  
  If the user already has a Drupal account and a corresponding CiviCRM contact then all works well. The user logs and and goes to the form, sees the existing information, changes what needs editing, submits, and the corresponding CiviCRM contact record is updated with the new information.
  
  The issue seems to be if there is a CiviCRM contact record and no associated Drupal account. If a user creates a new Drupal account then goes to the webform and submits it, a duplicate CiviCRM contact is created, the dedup rules are not used.
  
  I noticed that when choosing a ‘Matching Rule’ there is this information:
  
  > Note: Matching rules are only used if the contact is not already selected via "Existing Contact" field.
  
  Is there a way around this? I need to have the form autopopulate if the Drupal user already has a CiviCRM contact record so they know what their existing information is and what might need to be corrected. But at the same time if they are creating a new Drupal account I want to avoid getting a lot of duplicate CiviCRM contacts created.
  
  **Tags:** webform-civicrm, duplicate-contacts
  
  > **Comments:**
  > **username_1**: If they create a Drupal account is there already a duplicate before they fill the Webform? If so, you may be able to use a Profile on the Drupal account creation page that matches contacts to prevent duplicates there -- at which point the webform should function as expected.  
  > **username_2**: @username_1 I think this is the correct answer. Deduping should be performed on account creation.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-08-25. Score: 3
  
  If they create a Drupal account is there already a duplicate before they fill the Webform? If so, you may be able to use a Profile on the Drupal account creation page that matches contacts to prevent duplicates there -- at which point the webform should function as expected.
  
  
  ---
  
  ### Answer by username_3 on 2015-08-26. Score: 2
  
  The way we do it is that we have 2 webforms.
  
  The first form creates a civi-drupal linked user account. On this form we deactivate the existing user feature.
  We use the civicrm\_rules integration module and set a rule to create a drupal user for civicrm contacts who have a certain tag. [See here](https://civicrm.org/blogs/petednz/creating-drupal-users-made-easy-single-or-multiple-contacts-civi-imports-and-webforms) and we use the CiviGroup Roles Sync module to assign Drupal permissions.
  
  The second form includes the existing user but we set it to static and display name = yes.
  in form settings we set it to only allow authenticated users.
  
  
  ---
  
  