Two And A Half Tips

  • 1
  • 2
  • Question
  • Updated 2 years ago
  • Doesn't Need an Answer
  • (Edited)
I am running through 100s of formulas harvested from different sources and seeing some common patterns where the formula are overly complex and easy to fix:

(1) When forming a query clauses you don't have to include the single quotes popularized by the QuickBase documentation:

Instead of this:
{'3'.EX.'foo'}
Just use this:
{3.EX.foo}
(2) When forming HTML attributes you don't have to use an escaped double quotes:

Instead of this:
"<img src=\"https://www.quickbase.com/up/" & Dbid () & "/a/r" & [Record ID#] & "/e7/v0\" />"
Just use this:
"<img src='https://www.quickbase.com/up/" & Dbid () & "/a/r" & [Record ID#] & "/e7/v0' />"
In fact, HTML does not even require any attribute quotes if there are no spaces (or other offending characters) in the attribute value:
"<img src=https://www.quickbase.com/up/"; & Dbid () & "/a/r" & [Record ID#] & "/e7/v0 />"
(2.5) When using data-attributes on HTML elements you have to use quotes on attributes that might contain spaces (and a few other offending characters):
[iol] & "moduleTable.js" & [/iol]&
"<a class='QBU_Button Vibrant Success' " &
"  data-rid='" & [Record ID#] & "'" &
"  data-name='" & [Name] & "'" &
">Button</a>"
The single quotes are not needed on the data-rid attribute because a [Record ID#] will never contains a space but are needed on the data-name attribute because [Name] will likely contain a space. Additionally, if the field you are trying to pass in a data attribute itself contains quotes you would have to use an character entity (eg &quot;) to pass the value.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,522 Points 20k badge 2x thumb

Posted 2 years ago

  • 1
  • 2
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,756 Points 5k badge 2x thumb
Good! Thank you Dan for putting this together :)