Answers.Body: <p>Ah - I've run into that as well. You'll always get the #activities as specific in the CiviCRM -> Activities tab; </p>
  
  <p>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</p>
  
  <p>[yes we were/are using Assign to very litterally here ]</p>
  
  <p>Then you can clean out the ones that you don't want.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-13T19:20:59.440Z
Answers.LastActivityDate: 2017-03-13T20:55:21.773Z
Answers.LastEditDate: 2017-03-13T20:55:21.773Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>You can accomplish this by:</p>
  
  <ul>
  <li>For each activity, make the <em>Activity Type</em> field "user select".</li>
  <li>Edit those 3 <em>Activity Type</em> fields on the webform. For each one:
  
  <ul>
  <li>Deselect "list box"</li>
  <li>Deselect all activity types except the one you want.</li>
  <li>Rename that option to something like "Create activity"</li>
  </ul></li>
  <li>Add a conditional rule on the form showing/hiding other activity fields depending on the <em>Activity Type</em> field being checked.</li>
  </ul>
  
  <p>This will present a checkbox on the form allowing users to select whether or not they will create each activity.</p>
  
  <p>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 <a href="https://www.drupal.org/node/2858811" rel="nofollow noreferrer">fixing a bug</a> where it could not save activity details) so you may want to upgrade to the -dev version until the next release.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-15T15:31:51.723Z
Answers.Text: Ah - upgrading to -dev!
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-14T17:03:05.480Z
Answers.LastActivityDate: 2017-03-15T15:46:49.970Z
Answers.LastEditDate: 2017-03-15T15:46:49.970Z
Answers.UserDisplayName: Coleman
Body: <p>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. </p>
  
  <p>The problem i'm facing is that there are always 3 activities created.<br>
  If, for example the user selects only that a new household should only have a referral only to departments 2 &amp; 3 (ie. not to dept 1), i only want to create 2 activities, but 3 activities are created. </p>
  
  <p>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?</p>
  
Tags: <webform-civicrm><activities>
Title: create webform that allows user to create either 1, 2 or 3 activities depending on user selection
ThreadText: # create webform that allows user to create either 1, 2 or 3 activities depending on user selection
  
  (Asked by: username_0 on 2017-03-13)
  
  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?
  
  **Tags:** webform-civicrm, activities
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-03-14. Score: 5 | Accepted answer
  
  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](https://www.drupal.org/node/2858811) where it could not save activity details) so you may want to upgrade to the -dev version until the next release.
  
  > **Comments:**
  > **username_1**: Ah - upgrading to -dev!  
  
  ---
  
  ### Answer by username_1 on 2017-03-13. Score: 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.
  
  
  ---
  
  