8

Civicrm is extremely flexible with relationships. The downside of that is it's a pain to enter new household and their members. My users complain bitterly about how many steps it takes. Yes, there are some short cuts but it's still a lot of clicks. 99% of our households are husband wife and happen to live in the same house.

Some of the pain points mentioned are for hh to sort along with individuals in any list of contacts, you have to create the household with last name first, e.g. Smith, Barb and Steve. This means you then have to manually create the salutation manually, e.g. Dear Barb and Steve. They also complain about the address saying things like "why can't the individuals automatically inherit the hh address or if one of the ind has an address why can't the rest inherit it"

So has anyone create a form or maybe a webform that has something like this:

Contact 1: First Name, Last Name, email

Contact 2: First Name, Last Name, email (If last name same leave blank or prepopulate last name from contact 1)

Shared Address info:

Household info: Prepopulate household name from contact 1 and 2 (e.g. c1 Lastname, c1 first and c2 first or if c2 last is different C1 Last, C1 first and c2 Last, c2 first)
Prepopulate the salutations from c1 and c2 (e.g. Dear C1 First and C2 first)

Then when you save it, it creates the three contact records and the relationships, with hh having the address and the ind sharing it.

  • Want to confirm the CMS you are using? – petednz - fuzion Sep 22 '15 at 1:21
  • Production 4.5.8. Dev 4.6.7 (Just about the time I say I'll upgrade production another bug that will affect us surfaces.) – Paul-Tahoe Sep 22 '15 at 1:36
  • CMS not civicrm - Joomla, WP or Drupal? – petednz - fuzion Sep 22 '15 at 2:08
  • Ah, drupal. (I wouldn't have mentioned webforms for the others but you wouldn't know that). – Paul-Tahoe Sep 22 '15 at 2:53
  • Hi Paul, we have done what you're talking about with the drupal webform module. Takes work to set it up but it is some of the best time we've spent. Our users use it every day. I will try to write up the formula tomorrow at work. – Allen Hutchison Sep 22 '15 at 3:27
4

We have setup a webform which enables the creation (or updating existing information) of

1) a household with its own data (phone number and physical/mailing address)

2) one or two adults with their own data (defaulting to our Spouse/Spouse relationship) and makes them share the address of the Household

3) 1-5 children with their own data who share the address of the Household and allows you to choose the relationship to Adults 1 and 2

The length of the Node Export was more than Stack Exchange allowed me to paste in, so you can find the CSV here: https://www.dropbox.com/s/e4vw5a9o15c1aiz/node-export-household-and-family-webform.drupal?dl=0

I don't know how this would work with importing back into your system with Node Export given that we'll have different relationships and tags and slightly different needs, but I think this will get you on the way.

  • Hmm, I was able to import the node but alas the resulting node shows nothing but clone content. I went into edit and for some reason the format wasn't set. Set it to filtered so now I get the "Use this form..." but there is nothing else. I noticed what was imported was a page. I changed it to webform and now I see it. I get a bunch of "The webform component layout_box is not able to be displayed" at the top but I do see the form. Now to see if I can change the relationship types to what we use. – Paul-Tahoe Oct 8 '15 at 2:16
  • Any luck with the relationship types? Oh, and as you discovered we use extensively the Webform Layout module [drupal.org/project/webform_layout ]. – Allen Hutchison Oct 10 '15 at 17:57
  • 1
    Yes, I was able to get the relationship types to work. Pretty cool. You put a ton of work into setting this up. I also added the webform layout module. I'm a bit annoyed by the "standard" way webforms work when you pull up an existing hh, it doesn't automatically pull up the individuals unless you include the cid in the url. – Paul-Tahoe Oct 14 '15 at 21:22
  • Hi @Paul-Tahoe how did you get it to display all the fields in the webform after importing? After changing the node type to webform, when I go to edit the webform I have no fields displaying, and when i go to CiviCrm tab, all the contacts are there but nothing for each of the contacts is selected. setting a field to selected created the fieldset/field but I dont have the rest of the logic per whats in the imported file – DMOZ Aug 20 '16 at 5:08
2

In re-reading your question, we also came up with a jQuery solution for creating the Household Name from the names of the Parent and Spouse.

We added a class to the Parent First Name field, Parent Last Name field, the Spouse field, and the Household Name field (through the webform field UI itself, not on the Webform-CiviCRM section). (In our context most spouses have the same last name). Here's the script we put into a Mark Up field. Your markup text format input has to allow scripts:

 <script>
 $=jQuery;
 function HouseholdName(){
   var ParentFirst = $(".parent-first").val();
   var ParentLast = $(".parent-last").val();
   var SpouseFirst = $(".spouse-first").val();

   if (SpouseFirst != ''){
     $(".household-name").val(SpouseFirst + ' & ' + ParentFirst + ' ' + ParentLast);
   }

   else {
    $(".household-name").val(ParentFirst + ' ' + ParentLast);
   }
 }

 $(".parent-first").change(function(){
    HouseholdName();
 });
 $(".parent-last").change(function(){
    HouseholdName();
 });
 $(".spouse-first").change(function(){
    HouseholdName();
 });
</script>
  • 1
    Cool. I'll have to play with this. – Paul-Tahoe Oct 15 '15 at 22:52
1

Yes, you can create a webform to do exactly that. I have created one.

You just have to take the time to go through and set up the webform.

  • Can you do the default from another field so the household name could be defaulted? I assume you need to use tokens of some sort but haven't figured out how. Also, if you change the field the default is based upon does it update the default? – Paul-Tahoe Sep 22 '15 at 1:44
  • I believe it does have the ability to do something like that. – frTommy Sep 22 '15 at 1:50

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.