Answers.Body: <p>UPDATE: This feature has now been added to CiviCRM. <a href="https://github.com/civicrm/civicrm-core/pull/28112" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/28112</a></p>
  <hr />
  <p>It seems like a missing feature, being able to link the relationship to the case. Or more generally, allowing SearchKit selectors to specify another entity in the search (e.g. making &quot;Current Case&quot; available in this dropdown):</p>
  <p><a href="https://i.sstatic.net/iMotm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iMotm.png" alt="SK" /></a></p>
  <p>It would be great to get that feature sponsored and included in SearchKit!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-23T20:01:18.123Z
Answers.Text: Yes, that would be really great. Maybe it would be good to make an issue out of it? I could imagine that funding could be found - I'll ask around too.
Answers.UserDisplayName: Andreas
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-23T21:12:37.920Z
Answers.Text: I was just hitting this recently as well in replacing the old CiviCase dashboard.
Answers.UserDisplayName: Andy Burns
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-23T21:34:47.703Z
Answers.Text: Andreas that sounds like a good plan! Please ping me on chat.civicrm.org about it.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-23T19:24:44.380Z
Answers.LastActivityDate: 2023-11-11T20:57:49.170Z
Answers.LastEditDate: 2023-11-11T20:57:49.170Z
Answers.UserDisplayName: Coleman
Body: <p>I am struggling to create a SearchKit for the following usecase: I want to show a list of cases with their clients etc, but also with related contacts with a role on each case, e.g. the client's &quot;Benefits Specialist&quot; in our well-known &quot;Housing Support&quot;. This is my approach so far:</p>
  <p><a href="https://i.sstatic.net/mTbHx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mTbHx.png" alt="enter image description here" /></a></p>
  <p>As long as a client has only one case, things work as needed in the usecase (like in case id = 2). But as soon as a client has two or more cases, the grouping on case leads to a situation where I have all &quot;Benefit Specialists&quot; of all cases of these clients listed. In my example: Test Specialist 1 has a case role in case 1 and Test Specialist 2 in case 2 and both results are shown in the last column (it would even be worse, if I chose another field transformation).</p>
  <p>There is no error here, this works as expected from my configuration. But: I have no idea how to solve the use case with SearchKit. Until now I used Data Processor for that where I just have to use the output handler &quot;role on case&quot; where I can map the case id and that's it. One solution would be to start with the entity contact, but I need the case actions here... Can anyone help?</p>
  
Tags: <searchkit>
Title: SearchKit: How to display cases with related contacts and roles with more than one case per client?
ThreadText: # SearchKit: How to display cases with related contacts and roles with more than one case per client?
  
  (Asked by: username_0 on 2023-10-23)
  
  I am struggling to create a SearchKit for the following usecase: I want to show a list of cases with their clients etc, but also with related contacts with a role on each case, e.g. the client's "Benefits Specialist" in our well-known "Housing Support". This is my approach so far:
  
  [![enter image description here](https://i.sstatic.net/mTbHx.png)](https://i.sstatic.net/mTbHx.png)
  
  As long as a client has only one case, things work as needed in the usecase (like in case id = 2). But as soon as a client has two or more cases, the grouping on case leads to a situation where I have all "Benefit Specialists" of all cases of these clients listed. In my example: Test Specialist 1 has a case role in case 1 and Test Specialist 2 in case 2 and both results are shown in the last column (it would even be worse, if I chose another field transformation).
  
  There is no error here, this works as expected from my configuration. But: I have no idea how to solve the use case with SearchKit. Until now I used Data Processor for that where I just have to use the output handler "role on case" where I can map the case id and that's it. One solution would be to start with the entity contact, but I need the case actions here... Can anyone help?
  
  **Tags:** searchkit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-10-23. Score: 2 | Accepted answer
  
  UPDATE: This feature has now been added to CiviCRM. <https://github.com/civicrm/civicrm-core/pull/28112>
  
  ---
  
  It seems like a missing feature, being able to link the relationship to the case. Or more generally, allowing SearchKit selectors to specify another entity in the search (e.g. making "Current Case" available in this dropdown):
  
  [![SK](https://i.sstatic.net/iMotm.png)](https://i.sstatic.net/iMotm.png)
  
  It would be great to get that feature sponsored and included in SearchKit!
  
  > **Comments:**
  > **username_0**: Yes, that would be really great. Maybe it would be good to make an issue out of it? I could imagine that funding could be found - I'll ask around too.  
  > **username_2**: I was just hitting this recently as well in replacing the old CiviCase dashboard.  
  > **username_1**: username_0 that sounds like a good plan! Please ping me on chat.civicrm.org about it.  
  
  ---
  
  