3

I've created a drupal web-form that creates a household and 3 activities (each an activity type "referral" assigned to different department). I've also created conditional formatting to only show the activity details activity details for referrals to the departments that have been selected. So far so good.

The problem i'm facing is that there are always 3 activities created.
If, for example the user selects only that a new household should only have a referral only to departments 2 & 3 (ie. not to dept 1), i only want to create 2 activities, but 3 activities are created.

I think this is because in the webform-civicrm tab i've created three activities with the household members assigned. Is there a way to have a variable number of activities created?

4

You can accomplish this by:

  • For each activity, make the Activity Type field "user select".
  • Edit those 3 Activity Type fields on the webform. For each one:
    • Deselect "list box"
    • Deselect all activity types except the one you want.
    • Rename that option to something like "Create activity"
  • Add a conditional rule on the form showing/hiding other activity fields depending on the Activity Type field being checked.

This will present a checkbox on the form allowing users to select whether or not they will create each activity.

Note: This works in the current version of webform_civicrm but logs an error saying "could not create activity." I've fixed that superfluous error report in -dev (as well as fixing a bug where it could not save activity details) so you may want to upgrade to the -dev version until the next release.

2

Ah - I've run into that as well. You'll always get the #activities as specific in the CiviCRM -> Activities tab;

Best I could think of at the time was to bring the Assign to field as a checkbox to the Webform and say: "Reserve Seat": if checkbox checked the Activity would have an Assign to -> else it would be n/a

[yes we were/are using Assign to very litterally here 😀]

Then you can clean out the ones that you don't want.

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.