Answers.Body: <p>You can achieve this by:</p>
  
  <ol>
  <li>Ensure you are using the latest version of webform_civicrm</li>
  <li>(CiviCRM tab) Set the Case Type field to "user select"</li>
  <li>(Webform tab) Edit the Case Type webform component, and change the widget type to "hidden". Set it's value to the case type of your choosing.</li>
  <li>(Webform tab - Conditionals) Add a conditional rule to show/hide the Case Type element based on the value of another field of your choosing (it's a hidden field already, you say, what's the point of hiding it? Either way it won't appear to the user, but this conditional rule will prevent the case from being created if your condition is not met).</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-28T06:11:24.683Z
Answers.Text: This is SO awesome. Thank you very much! It worked perfectly.
Answers.UserDisplayName: Kristine
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-28T13:49:33.833Z
Answers.Text: No prob. Webform conditionals can be quite powerful - preventing a hidden field from submitting its value by "hiding" it is a cool trick. Another neat trick is that you can use a conditional to change the value of a hidden filed. I.e. you could cause it to open a different *type* of case depending on some conditions, or many other possibilities.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-27T23:58:57.760Z
Answers.LastActivityDate: 2015-06-27T23:58:57.760Z
Answers.UserDisplayName: Coleman
Body: <p>I am just starting to learn the Webform integration with CiviCRM. I know that I am able to open a case via the webform module. However, I <em>only</em> want to open a case if a condition is met. </p>
  
  <p>For example, when the status field is equal to "Accepted", I like for the case information to show. Currently, I tried adding all the case information and tried leaving it blank, but it produces an error "Sorry but we are not able to provide this at the moment" as a result of missing information (I believe). Have anyone accomplished something similar to this?</p>
  
Tags: <webform-civicrm><civicase>
Title: Webform: Only Open Case if Condition is True
ThreadText: # Webform: Only Open Case if Condition is True
  
  (Asked by: username_0 on 2015-06-27)
  
  I am just starting to learn the Webform integration with CiviCRM. I know that I am able to open a case via the webform module. However, I *only* want to open a case if a condition is met.
  
  For example, when the status field is equal to "Accepted", I like for the case information to show. Currently, I tried adding all the case information and tried leaving it blank, but it produces an error "Sorry but we are not able to provide this at the moment" as a result of missing information (I believe). Have anyone accomplished something similar to this?
  
  **Tags:** webform-civicrm, civicase
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-27. Score: 2 | Accepted answer
  
  You can achieve this by:
  
  1. Ensure you are using the latest version of webform\_civicrm
  2. (CiviCRM tab) Set the Case Type field to "user select"
  3. (Webform tab) Edit the Case Type webform component, and change the widget type to "hidden". Set it's value to the case type of your choosing.
  4. (Webform tab - Conditionals) Add a conditional rule to show/hide the Case Type element based on the value of another field of your choosing (it's a hidden field already, you say, what's the point of hiding it? Either way it won't appear to the user, but this conditional rule will prevent the case from being created if your condition is not met).
  
  > **Comments:**
  > **username_0**: This is SO awesome. Thank you very much! It worked perfectly.  
  > **username_1**: No prob. Webform conditionals can be quite powerful - preventing a hidden field from submitting its value by "hiding" it is a cool trick. Another neat trick is that you can use a conditional to change the value of a hidden filed. I.e. you could cause it to open a different *type* of case depending on some conditions, or many other possibilities.  
  
  ---
  
  