Forum Discussion

MeaganMcOlin's avatar
MeaganMcOlin
Qrew Cadet
5 hours ago

How to display clickable links from two separate tables under one field

I have an app with the following setup. 

  • IVRT and ARHIFU are parent tables.
  • All Patients is the child table.

In All Patients, I have lookup fields pulling in patient name report link fields from both the IVRT and ARHIFU tables:

  • [IVRT Patient Name Link] (from IVRT)
  • [ARHIFU Patient Name Link] (from ARHIFU)

These lookup fields correctly show the patient names as clickable links in the All Patients table.

Now, I would like to display the clickable links from both of these parent tables under one field in the All Patients table. (See attachment).

The problem I am running into is keeping them as clickable links. 

How can I display the clickable links from both parent tables under one field in All Patients?

If a formula is needed to achieve this, what would that formula look like?

Thank you!
Meagan

3 Replies

  • Megan,

    Make a Formula Rich Text field.  You can the build out simple or sophisticated set of links in that field.  You can use some HTML to build a table, colorize or otherwise surface the two links for your Users.    The Magic Buttons application from Kirk Trachy was full of great examples of how to do this.

    A quick and dirty example is 

    var text LinkOne = URL for getting to parent one;

    var text LinkTwo = URL for getting to parent two;

    $LinkOne   & "<br>" &

    $LinkTwo

    That will give you both links on two rows, in the same field.

     

     

    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      Don beat me to it,  but here is an example with more detail

      var text OrderURL = 
        URLRoot() & "db/" & [_DBID_ORDERS] & "?a=dr&rid=" & [Related Order];

      var text PurchaseOrderURL = 
        URLRoot() & "db/" & [_DBID_PURCHASE_ORDERS] & "?a=dr&rid=" & [Related Purchase Order];
        
      var text URLONE = 
      "<a href=" & $OrderURL & ">" & [Order Identifier] & "</a>";

      var text URLTWO = 
      "<a href=" & $PurchaseOrderURL & ">" & [PO Identifier] & "</a>";

       

      List("<br>",
      If([Related Order]>0, $URLONE),
      If([Related Purchase Order]>0, $URLTWO))

      In the example above, the links will only show if there is indeed a link to go to. So there might be two links showing or one link showing or maybe no link showing if for some reason, the record is a complete orphan. 

      • DonLarson's avatar
        DonLarson
        Qrew Elite

        Megan,

        Mark's is better.   The logic to hide an invalid link will serve you well.

        See if you get Magic Button's for some very good examples.