Answers.Body: <p>You can come oh-so-close with searchkit and formbuilder, but it only works if the logged-in user is viewing their own contact. It might be worth posting in <a href="https://chat.civicrm.org" rel="nofollow noreferrer">https://chat.civicrm.org</a> in the searchkit channel if there's a way to get the &quot;currently viewed contact id&quot; and use that in the WHERE clause.</p>
  <p>If there were, then you can set up a search that outputs external_id, and uses the &quot;currently viewed contact id&quot; in the where clause, then add a search display and use the &quot;rewrite&quot; option for the external id field to make it the url and insert token <code>[external_identifier]</code>.</p>
  <p>Then create a formbuilder form for the display, and choose the option to &quot;add to contact summary page&quot;.</p>
  <p>You can also do it with custom code and hooks, but not sure if that's what you're looking for.</p>
  <p>Here's a screenshot of what it looks like with &quot;currently logged in user&quot; in the where clause:</p>
  <p><a href="https://i.sstatic.net/XUIDL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XUIDL.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-03T00:10:01.767Z
Answers.LastActivityDate: 2022-12-03T00:10:01.767Z
Answers.UserDisplayName: Demerit
Body: <p>i have data on my contacts spread over different systems, among which civicrm.
  i do have keys of the external system in civicrm, e.g. an id <code>123</code>.
  now, this key can be used to browse info on this contact at <code>https://externalsystem.tld/users/123</code>.</p>
  <p>technically, just knowing the id <code>123</code> would be enough to then look up such further info, and might save our database some space over also storing the full URLs.</p>
  <p>however, from a UX perspective, it would be nice if our people browsing the civicrm contacts would simply have a link or even button per contact, saving them the labor of manually constructing URLs to then manually open, if they wanted to look up a contact in the external system.</p>
  <p>how might we give our contact UI buttons or URLs like this?</p>
  
Tags: <contacts><contact-view><links><button>
Title: link contacts to external systems
ThreadText: # link contacts to external systems
  
  (Asked by: username_0 on 2022-12-02)
  
  i have data on my contacts spread over different systems, among which civicrm.
  i do have keys of the external system in civicrm, e.g. an id `123`.
  now, this key can be used to browse info on this contact at `https://externalsystem.tld/users/123`.
  
  technically, just knowing the id `123` would be enough to then look up such further info, and might save our database some space over also storing the full URLs.
  
  however, from a UX perspective, it would be nice if our people browsing the civicrm contacts would simply have a link or even button per contact, saving them the labor of manually constructing URLs to then manually open, if they wanted to look up a contact in the external system.
  
  how might we give our contact UI buttons or URLs like this?
  
  **Tags:** contacts, contact-view, links, button
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-12-03. Score: 2
  
  You can come oh-so-close with searchkit and formbuilder, but it only works if the logged-in user is viewing their own contact. It might be worth posting in <https://chat.civicrm.org> in the searchkit channel if there's a way to get the "currently viewed contact id" and use that in the WHERE clause.
  
  If there were, then you can set up a search that outputs external\_id, and uses the "currently viewed contact id" in the where clause, then add a search display and use the "rewrite" option for the external id field to make it the url and insert token `[external_identifier]`.
  
  Then create a formbuilder form for the display, and choose the option to "add to contact summary page".
  
  You can also do it with custom code and hooks, but not sure if that's what you're looking for.
  
  Here's a screenshot of what it looks like with "currently logged in user" in the where clause:
  
  [![enter image description here](https://i.sstatic.net/XUIDL.png)](https://i.sstatic.net/XUIDL.png)
  
  
  ---
  
  