0

Is it possible to make a Drupal Webform which always creates a new contact but uses Existing Contact for prefilling?

The use-case is that the data needs to be updated but supervised by another human. So what I in effect need is for my drupal webform to create a duplicate based on the existing contact. Duplicates are then to be merged by a supervised deduplication process.

How would I go about doing this? Would it be a matter of inserting some code before the form is processed or is the entire Existing Contact framework more complicated then that? Or is there an easier way to achieve this?

  • 1
    pls explain what would cause the Existing Contact to prefill? Are you using a cid in the URL, or is it for the logged in person. If the latter you might do better to show then a Drupal Block of their 'existing data' and have them fill in a blank form with any changes required. And make sure that the dedupe rule ensures there is no matching happening so a new contact is created. But I appreciate that means the person is having to retype info that you already have about them. – petednz - fuzion Jan 28 at 0:22
  • 1
    alternatively how about - webform has 2 contacts. one prefills but all fields are locked. hence no changes are made. use some js to copy data from c1 to c2 where the user can then edit etc. – petednz - fuzion Jan 28 at 0:23
  • @petednz-fuzion this is very clever thinking! Thank you! I would use both URL and autocomplete search. – Marko Jan 28 at 0:58
  • ok, well if you detail what you do as a solution as the Answer then I will +1 it for you :-) – petednz - fuzion Jan 28 at 5:04
1

Check out I3Val Input Validation (https://github.com/systopia/be.aivl.i3val/blob/master/docs/index.md) as this allows backend validation before changes go into Civi. It may save people having to complete information again that hasn't changed and from an admin perspective unlikely more work than having to check and then dedupe.

| improve this answer | |
  • Thank you for the answer. I've finally found some time to investigate i3val and XCM (which I've never used before), and they look great. Does this work with Drupal webform integration, however? As far as I can see this only works if I use it with XCM, which has a new getorcreate api action. – Marko Feb 2 at 12:56
  • The XCM is as far as I'm aware only an example and i3Val can be set up to use Drupal Webform info in the same way as other external data. – RebeccaTregenna Feb 4 at 10:45

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.