Is there a way to consolidate multiple URL buttons into one button, but use the link text/color of each individual button

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • In Progress
I currently have 4 different buttons that do 4 different things (and am about to add more).
To avoid having users click the wrong button inadvertently, they only show on certain records depending on the record type.

Since I'm about to add more buttons, I'd like to see if there is a way to consolidate all of these buttons into one.

I need the button to show the action (label of the original button)

I thought if I added an IF statement to a Rich Text field that displayed the appropriate button that would solve my issue, but it only displays the text of the button, not the button itself.

Three of the different buttons:


What the Rich Text formula returns (apologies for the redaction):


The formula is working, by pasting the correct button ... it just pastes the formula behind the button and not the button itself.

I figured if I do this on a URL field, it will work ... but I will then only be able to display the text of that field, and not the individual fields that are being referenced.

Below is an example of it working, but only with the text of that assigned button:
Photo of Eric Evans-Vargas

Eric Evans-Vargas

  • 586 Points 500 badge 2x thumb

Posted 4 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 67,348 Points 50k badge 2x thumb
The format for a Rich text field is

var text Words = "My words including any HTML";
var text URL = a formula for the URL with a IF;

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

Photo of Eric Evans-Vargas

Eric Evans-Vargas

  • 586 Points 500 badge 2x thumb
I'm afraid I don't follow ... have I mentioned I'm terrified of java ...
I've tried plugging in the formulas but don't quite think I know what I've done.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,348 Points 50k badge 2x thumb
I would have to see your attempt in order to edit it.  Paste it in the forum, but the forum tends to garble postings with hyperlinks, so you you may need to post it in and then highlight it and use the PRE button below the box.
(Edited)
Photo of Eric Evans-Vargas

Eric Evans-Vargas

  • 586 Points 500 badge 2x thumb
Here's what I've done so far ... trying to add on two of the buttons first:

If([Leave Type]="Transitional Duty" and [Leave Report Date]=Today(),
var text Words = "OT on Trans Duty";
var text url= 
"<a href=" & $URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
"&apptoken=####"&
        "&_fid_70=True" &
        "&_fid_67=OT on Transitional Duty" &
        "&_fid_58="& URLEncode(User()); & ">" & $Words & "/>"
[Leave Description]="Continuous" and [Leave Report Date]=Today(),
var text Words = "RTW"
var text url= 
"<a href=" &$URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
"&apptoken=####"&
        "&_fid_63=True" &
        "&_fid_67=Return to Work" &
        "&_fid_58="& URLEncode(User());
   
"javascript:" & "$.get('" & $url & "', function(){" & "location.reload();" &
    "});" & "void(0);"
,"")

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,348 Points 50k badge 2x thumb
I think I would have to work with you one on one to unscramble that.
QuickBaseCoach.com
Photo of Eric Evans-Vargas

Eric Evans-Vargas

  • 586 Points 500 badge 2x thumb
Yeah, I sliced it and diced it really good - i have no clue what I did. :)
I'll reach out, thanks!