Answers.Body: <p>Probably the <code>name</code> is different from the <code>label</code>. The most common cause
  for that is that you created the activity and then renamed it, which would have altered the label but not the name.</p>
  <p>You should inspect your <code>civicrm_option_value</code> table and compare activity names with labels.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-15T17:37:03.097Z
Answers.Text: That looks to be exactly correct, thanks. Can I just change the name in the DB or is that going to cause problems somewhere else?
Answers.UserDisplayName: zip
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-15T23:49:12.797Z
Answers.Text: As long as you don't have any other saved searches (or custom code) referring to that activity type, it should be safe to change the name.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-15T17:24:22.993Z
Answers.LastActivityDate: 2024-10-15T17:24:22.993Z
Answers.UserDisplayName: Coleman
Body: <p>Odd behavior I've noticed:</p>
  <p>I have an Activity Type with ID 78 and Label [just an example] &quot;Activity Type X&quot;</p>
  <p>I have another Activity Type with ID 79 and Label &quot;Activity Type Y&quot;</p>
  <p>Using the API or the standard builtin Activity search, I can query these activities as you would expect.</p>
  <p>Using SearchKit though, when I select <em>either</em> of these two, it will only search for ID 78. When I look at the Query info Tab, the SQL always looks like:</p>
  <pre><code>    SELECT `a`.`id` AS `id`, `a`.`subject` AS `subject`, `a`.`activity_type_id` AS `activity_type_id:label`
  FROM civicrm_activity a
  WHERE (`a`.`activity_type_id` = &quot;78&quot;)
    AND (`a`.`is_test` = &quot;0&quot;)
    AND (`a`.`is_deleted` = &quot;0&quot;)
  ORDER BY `a`.`subject` ASC
  LIMIT 50
  OFFSET 0
  </code></pre>
  <p>And the API section looks like:</p>
  <pre><code>{
    &quot;version&quot;: 4,
    &quot;select&quot;: [
      &quot;id&quot;,
      &quot;subject&quot;,
      &quot;activity_type_id:label&quot;
    ],
    &quot;orderBy&quot;: {},
    &quot;where&quot;: [
      [
        &quot;activity_type_id:name&quot;,
        &quot;=&quot;,
        &quot;Activity Type Y&quot;
      ]
    ],
    &quot;groupBy&quot;: [],
    &quot;join&quot;: [],
    &quot;having&quot;: []
  }
  </code></pre>
  <p>That is, the label from one type and the ID from the other!</p>
  <p>Any thoughts?</p>
  
Tags: <searchkit>
Title: SearchKit seems to be conflating two Activity Types
ThreadText: # SearchKit seems to be conflating two Activity Types
  
  (Asked by: username_0 on 2024-10-15)
  
  Odd behavior I've noticed:
  
  I have an Activity Type with ID 78 and Label [just an example] "Activity Type X"
  
  I have another Activity Type with ID 79 and Label "Activity Type Y"
  
  Using the API or the standard builtin Activity search, I can query these activities as you would expect.
  
  Using SearchKit though, when I select *either* of these two, it will only search for ID 78. When I look at the Query info Tab, the SQL always looks like:
  
  ```
      SELECT `a`.`id` AS `id`, `a`.`subject` AS `subject`, `a`.`activity_type_id` AS `activity_type_id:label`
  FROM civicrm_activity a
  WHERE (`a`.`activity_type_id` = "78")
    AND (`a`.`is_test` = "0")
    AND (`a`.`is_deleted` = "0")
  ORDER BY `a`.`subject` ASC
  LIMIT 50
  OFFSET 0
  
  ```
  
  And the API section looks like:
  
  ```
  {
    "version": 4,
    "select": [
      "id",
      "subject",
      "activity_type_id:label"
    ],
    "orderBy": {},
    "where": [
      [
        "activity_type_id:name",
        "=",
        "Activity Type Y"
      ]
    ],
    "groupBy": [],
    "join": [],
    "having": []
  }
  
  ```
  
  That is, the label from one type and the ID from the other!
  
  Any thoughts?
  
  **Tags:** searchkit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-10-15. Score: 3 | Accepted answer
  
  Probably the `name` is different from the `label`. The most common cause
  for that is that you created the activity and then renamed it, which would have altered the label but not the name.
  
  You should inspect your `civicrm_option_value` table and compare activity names with labels.
  
  > **Comments:**
  > **username_0**: That looks to be exactly correct, thanks. Can I just change the name in the DB or is that going to cause problems somewhere else?  
  > **username_1**: As long as you don't have any other saved searches (or custom code) referring to that activity type, it should be safe to change the name.  
  
  ---
  
  