Adding Hyperlinks to a Formula Text (or Rich Text) Field

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
I have a field where I am trying to allow for simple IF formula to show either an Individual's Name or an Organization's Names depending on if they have selected a record from the Individuals Table or the Organizations Table. 

If formula is easy 

If([Related Individual]=null,[Organization Name],[Individual - Full Name])

However by doing this the records no longer link to their original record in their specific tables. I would imagine the solution is to make a Rich Text Formula field and some sort of HTML. Anyone have it handy or can problem solve it? It seems like it should be some sort of hyperlink HTML to go with that simple IF formula and it should work but i tried doing an <a href=""> formula and it didn't work for me.
Photo of Michael Bralow

Michael Bralow

  • 204 Points 100 badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,326 Points 50k badge 2x thumb
This is possible, but I need to understand more.  So the link needs to  to display a parent record, but the parent might be in table A or table B?  Is that what you need?
Photo of Michael Bralow

Michael Bralow

  • 204 Points 100 badge 2x thumb
thats exactly right! I figure the easiest way is what I am describing but maybe i'm not thinking outside the box! 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,326 Points 50k badge 2x thumb
When I make Hyperlinks I always make them the same way, no matter how simple or complex.

var text Words = If(
[Related Individual]=null,[Organization Name],
[Individual - Full Name]<>"", [Individual - Full Name]);

var text URL =
IF(
[Related Individual]>0, urlroot() & "db/" & [_DBID_OF_THE_INDIVIDUALS_TABLE] & "?a=dr&rid=" & [Related Individual],

[Related Organization]>0, urlroot() & "db/" & [_DBID_OF_THE_ORGANIZATION_TABLE] & "?a=dr&rid=" & [Related Organization]);

"<a href=" & $URL & ">" & $Words & "</a>"

You will ned to obtain the correct table names from the advanced properties for the table.  It's down near the bottom.
Photo of Michael Bralow

Michael Bralow

  • 204 Points 100 badge 2x thumb
this was perfect and a great way of doing this i will remember going forward. Thanks!