Can I change this formula URL button to Formula Text so that I can use Icons for the Links???

  • 1
  • 1
  • Question
  • Updated 2 years ago
  • Answered
Photo of Michael Graham | Insight Global UK

Posted 2 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
Here is a general format for a hyperlink.  

Hyperlink Image example

var text Image = “<img src= https://images.quickbase.com/si/24/211-check_all.png>;

var text URL = URLRoot() & "db/" & [_DBID_PATIENTS] & "?a=dr&rid=" & [Related Patient];


"<a href=" & $URL & ">" & $Image & "</a>"
Photo of David

David

  • 836 Points 500 badge 2x thumb
Lots of examples like that in the Magic Buttons app in the exchange.
Not with that particular requirement. :(
Hi Mark, Im still not sure how that formula will help me load a PAGE?
Im trying to build it with your variables but the result it shows is just text of the link plus the actual image.

< a href=https://xpart.quickbase.com/db/bksnx5bbc?a=showpage&pageid=15>IMAGE


Formula Text Field:

var text Image = "<img src= https://images.quickbase.com/si/24/211-check_all.png>";
var text URL = "https://xpart.quickbase.com/db/bksnx5bbc?a=showpage&pageid=15";

"< a href=" & $URL & ">" & $Image & "</a>"
Its the syntax of the var text URL that I have wrong!
but don't know how to fix it.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
I think that this part has an extra space
< a href="

it should be

<a href="
Im making progress but having errors with syntax.  Cant see what Im doing wrong here?

var text Image = "<img src= https://images.quickbase.com/si/24/211-check_all.png>";

var text URL = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=15";

var text URL2 = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=16";

If (
[Vehicle Range]=16519, "<a href=" & $URL & ">" & $Image & "</a>",

[Vehicle Range]=25447, "<a href=" & $URL2 & ">" & $Image & "</a>"
)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
What is the error or symptom of the problem, and do you have the check box checked to allow HTML?
Please check the syntax of your entire formula. Possible culprits are a mismatched set of parentheses, missing quotes, or an extra bracket.


var text Image = "<img src= https://images.quickbase.com/si/24/211-check_all.png>";

var text URL = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=15";

var text URL2 = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=16";

If (
[Vehicle Range]=16519, "<a href=" & $URL & ">" & $Image & "</a>",

[Vehicle Range]=25447, "<a href=" & $URL  2 & ">" & $Image & "</a>"
)
I see the spaces in URL  2   but they aren't in my formula!!!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
There is a space in the URL 2 in the last line  it should be URL2
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
The variable name URL 2 is illegal syntax. Change it to read URLTWO


var text Image = "<img src= https://images.quickbase.com/si/24/211-check_all.png>";

var text URL = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=15";

var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=16";

If (
[Vehicle Range]=16519, "<a href=" & $URL & ">" & $Image & "</a>",

[Vehicle Range]=25447, "<a href=" & $URLTWO & ">" & $Image & "</a>"
)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
The variable names can only use A-Z.  No numeric or special characters are allowed.  just ABCD ... Z
By jolly jove, I think I've got it!
That works great for all 14 cars.  I can now put individual images on them too.
Thanks a lot Mark!!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
Great, next time I need a part for my wife's Mini I will come to your app.
Ha, www.somerfordmini.co.uk  is a website we did a few years ago.  Get your stuff there :)