Body: <p>I have a case configuration that includes a specific activity type (lets call it activity type A) in the standard timeline. This is useful for users who want to create and manage a case directly within CiviCRM, as it ensures that important activities are set up in the case for them.</p>
  
  <p>I have a Drupal webform for users who don't have Civi access to enable them to create a case and populate an instance of activity type A within the case.</p>
  
  <p>The webform is set up such that case processing is turned on and a new case of the required type is created. Activity processing is turned on, and activity type A is set up within the webform such that an existing activity of scheduled status gets updated, and that activity is filed on the case that is created by the webform.</p>
  
  <p>My assumption with this configuration is that as the form submission gets processed, the case (complete with its default scheduled instance of activity type A) is created, and the submission data is used to populate that activity record.</p>
  
  <p>However, what appears to be happening is that the case is being created, and a new activity (type A) is also being created and populated, and filed on the case, such that the resulting case has two instances of activity type A (one populated with my data, and a second, empty one - presumably the default instance created when the case was created.</p>
  
  <p>So, given that I don't want to remove the instance of activity type A defined in the standard timeline of the case configuration, how can I alter the settings within the webform such that the webform identifies and populates this activity rather than making a new one?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-03T01:14:20.493Z
Comments.Text: Hi Graham. Happy to have Coleman say it is possible but not sure if you will get this on a single form. I expect it doesn't know that an Activity of that type will be created, hence it adds a new one. Is two daisy-chained forms out of the question?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-03T09:44:37.663Z
Comments.Text: Hmmm. It feels to me like it should be possible. However, in this instance I'm already using two daisy chained forms, so I guess I could set up the first form to create the case. Then the second form just looks for a pre-existing activity and fills it.
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-03T21:37:15.343Z
Comments.Text: Perhaps create a view of the timeline activity to get the activity id with one big button that says next (that links to the activity Webform). Then change the Open Case Webform to redirect to that view..
Comments.UserDisplayName: pmoz
Tags: <drupal><webform-civicrm><civicase><activities>
Title: What are the optimal settings to enable a Drupal webform to create a case and populate an activity within the case?
ThreadText: # What are the optimal settings to enable a Drupal webform to create a case and populate an activity within the case?
  
  (Asked by: username_0 on 2016-03-02)
  
  I have a case configuration that includes a specific activity type (lets call it activity type A) in the standard timeline. This is useful for users who want to create and manage a case directly within CiviCRM, as it ensures that important activities are set up in the case for them.
  
  I have a Drupal webform for users who don't have Civi access to enable them to create a case and populate an instance of activity type A within the case.
  
  The webform is set up such that case processing is turned on and a new case of the required type is created. Activity processing is turned on, and activity type A is set up within the webform such that an existing activity of scheduled status gets updated, and that activity is filed on the case that is created by the webform.
  
  My assumption with this configuration is that as the form submission gets processed, the case (complete with its default scheduled instance of activity type A) is created, and the submission data is used to populate that activity record.
  
  However, what appears to be happening is that the case is being created, and a new activity (type A) is also being created and populated, and filed on the case, such that the resulting case has two instances of activity type A (one populated with my data, and a second, empty one - presumably the default instance created when the case was created.
  
  So, given that I don't want to remove the instance of activity type A defined in the standard timeline of the case configuration, how can I alter the settings within the webform such that the webform identifies and populates this activity rather than making a new one?
  
  **Tags:** drupal, webform-civicrm, civicase, activities
  
  > **Comments:**
  > **username_1**: Hi username_0. Happy to have Coleman say it is possible but not sure if you will get this on a single form. I expect it doesn't know that an Activity of that type will be created, hence it adds a new one. Is two daisy-chained forms out of the question?  
  > **username_0**: Hmmm. It feels to me like it should be possible. However, in this instance I'm already using two daisy chained forms, so I guess I could set up the first form to create the case. Then the second form just looks for a pre-existing activity and fills it.  
  > **username_2**: Perhaps create a view of the timeline activity to get the activity id with one big button that says next (that links to the activity Webform). Then change the Open Case Webform to redirect to that view..  
  
  ---
  
  ## 0 answers
  
  