Answers.Body: <p>It looks like the bug is triggered when you use &quot;Distinct&quot; mode for grouping. I'll take a look at what's going on there, but in the meantime you can disable &quot;Distinct.&quot; When I did that, all the links pointed to the correct contact.</p>
  <p>To disable it, open up &quot;Field Transformations&quot; and uncheck the box like this:</p>
  <p><a href="https://i.sstatic.net/jthhF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jthhF.png" alt="Distinct" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-01T22:08:50.097Z
Answers.LastActivityDate: 2023-03-01T22:08:50.097Z
Answers.UserDisplayName: Coleman
Body: <p>When using SearchKit and there are multiple profiles in the same row of the result, when I click on a to open a contact profile, sometimes an incorrect contact profile will open.</p>
  <p>This happens using the link in the (List) Display Name column, and the profile that opens does seem to be that of another contact in the row. However, for some of the contacts the correct profile does open. Is this happening for anyone else?</p>
  <p>Steps to re-produce in demo site:</p>
  <ol>
  <li><p>Create following <a href="https://dmaster.demo.civicrm.org/civicrm/admin/search#/create/Contact?params=%7B%22version%22:4,%22select%22:%5B%22COUNT(id)%20AS%20COUNT_id%22,%22GROUP_CONCAT(DISTINCT%20display_name)%20AS%20GROUP_CONCAT_display_name%22,%22GROUP_CONCAT(DISTINCT%20Contact_Email_contact_id_01.email)%20AS%20GROUP_CONCAT_Contact_Email_contact_id_01_email%22,%22SUM(Contact_Contribution_contact_id_01.total_amount)%20AS%20SUM_Contact_Contribution_contact_id_01_total_amount%22,%22Contact_Contribution_contact_id_01.receive_date%22%5D,%22orderBy%22:%7B%7D,%22where%22:%5B%5B%22Contact_Contribution_contact_id_01.total_amount%22,%22%3E%22,%22100%22%5D%5D,%22groupBy%22:%5B%22Contact_Contribution_contact_id_01.receive_date%22%5D,%22join%22:%5B%5B%22Email%20AS%20Contact_Email_contact_id_01%22,%22LEFT%22,%5B%22id%22,%22%3D%22,%22Contact_Email_contact_id_01.contact_id%22%5D%5D,%5B%22Contribution%20AS%20Contact_Contribution_contact_id_01%22,%22INNER%22,%5B%22id%22,%22%3D%22,%22Contact_Contribution_contact_id_01.contact_id%22%5D%5D%5D,%22having%22:%5B%5D%7D" rel="nofollow noreferrer">search</a> and click Search
  <a href="https://i.sstatic.net/h2KSV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/h2KSV.png" alt="Search image 1" /></a></p>
  </li>
  <li><p>Scroll to row where (Count) contact ID = 30, or you see multiple names in the (List) Display Name column</p>
  </li>
  </ol>
  <p><a href="https://i.sstatic.net/qZkjq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qZkjq.png" alt="Search image 2" /></a></p>
  <ol start="3">
  <li><p>Click Alexia Müller to try to open their profile (contact ID 157)</p>
  </li>
  <li><p>It opens Kiara Jameson's profile (contact ID 42)
  <a href="https://i.sstatic.net/nCs6a.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nCs6a.png" alt="enter image description here" /></a></p>
  </li>
  <li><p>Repeat Steps 1-2 above search and try Mrs. Justina Jameson, it opens the correct profile.</p>
  </li>
  <li><p>Note that some contacts in Display Name list are correct like beulaj@testing.co.uk (<a href="https://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&amp;cid=109" rel="nofollow noreferrer">https://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&amp;cid=109</a>) but the next contact in the list, brigettew19@fakemail.biz, has the same link to the beulaj@testing.co.uk contact .</p>
  </li>
  </ol>
  
Tags: <searchkit>
Title: SearchKit: incorrect contact profile opening from (list) Display Name column
ThreadText: # SearchKit: incorrect contact profile opening from (list) Display Name column
  
  (Asked by: username_0 on 2023-02-28)
  
  When using SearchKit and there are multiple profiles in the same row of the result, when I click on a to open a contact profile, sometimes an incorrect contact profile will open.
  
  This happens using the link in the (List) Display Name column, and the profile that opens does seem to be that of another contact in the row. However, for some of the contacts the correct profile does open. Is this happening for anyone else?
  
  Steps to re-produce in demo site:
  
  1. Create following [search](https://dmaster.demo.civicrm.org/civicrm/admin/search#/create/Contact?params=%7B%22version%22:4,%22select%22:%5B%22COUNT(id)%20AS%20COUNT_id%22,%22GROUP_CONCAT(DISTINCT%20display_name)%20AS%20GROUP_CONCAT_display_name%22,%22GROUP_CONCAT(DISTINCT%20Contact_Email_contact_id_01.email)%20AS%20GROUP_CONCAT_Contact_Email_contact_id_01_email%22,%22SUM(Contact_Contribution_contact_id_01.total_amount)%20AS%20SUM_Contact_Contribution_contact_id_01_total_amount%22,%22Contact_Contribution_contact_id_01.receive_date%22%5D,%22orderBy%22:%7B%7D,%22where%22:%5B%5B%22Contact_Contribution_contact_id_01.total_amount%22,%22%3E%22,%22100%22%5D%5D,%22groupBy%22:%5B%22Contact_Contribution_contact_id_01.receive_date%22%5D,%22join%22:%5B%5B%22Email%20AS%20Contact_Email_contact_id_01%22,%22LEFT%22,%5B%22id%22,%22%3D%22,%22Contact_Email_contact_id_01.contact_id%22%5D%5D,%5B%22Contribution%20AS%20Contact_Contribution_contact_id_01%22,%22INNER%22,%5B%22id%22,%22%3D%22,%22Contact_Contribution_contact_id_01.contact_id%22%5D%5D%5D,%22having%22:%5B%5D%7D) and click Search
     [![Search image 1](https://i.sstatic.net/h2KSV.png)](https://i.sstatic.net/h2KSV.png)
  2. Scroll to row where (Count) contact ID = 30, or you see multiple names in the (List) Display Name column
  
  [![Search image 2](https://i.sstatic.net/qZkjq.png)](https://i.sstatic.net/qZkjq.png)
  
  3. Click Alexia Müller to try to open their profile (contact ID 157)
  4. It opens Kiara Jameson's profile (contact ID 42)
     [![enter image description here](https://i.sstatic.net/nCs6a.png)](https://i.sstatic.net/nCs6a.png)
  5. Repeat Steps 1-2 above search and try Mrs. Justina Jameson, it opens the correct profile.
  6. Note that some contacts in Display Name list are correct like beulaj@testing.co.uk (<https://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=109>) but the next contact in the list, brigettew19@fakemail.biz, has the same link to the beulaj@testing.co.uk contact .
  
  **Tags:** searchkit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-03-01. Score: 2
  
  It looks like the bug is triggered when you use "Distinct" mode for grouping. I'll take a look at what's going on there, but in the meantime you can disable "Distinct." When I did that, all the links pointed to the correct contact.
  
  To disable it, open up "Field Transformations" and uncheck the box like this:
  
  [![Distinct](https://i.sstatic.net/jthhF.png)](https://i.sstatic.net/jthhF.png)
  
  
  ---
  
  