Skip to main content
Question

Formula RTF - Syntax Error

  • November 4, 2020
  • 0 replies
  • 29 views

Hi All,

I am getting this error msg in a Formula RFT field "A variable declaration must end with a semi-colon"

I have tried various options but can't resolve it. Any assistance would be appreciated.

var text mainStyle = "width: 650px; height: 25px; display: flex; color: #FFFFFF; font: normal 600 14px/1 'Calibri', sans-serif;";
var text style = "width: 100px; height: 30px; text-align: center; display: flex; justify-content: center; align-items: center; margin: 0px 1px;";
var text Registered = If(
[Status] = "Registered", "<div style=\"" & $style & " background: #57a3f0; border-radius: 12.5px 0px 0px 12.5px; \"><p>Registered</p></div>",
"<div style=\"" & $style & " background: #57a3f0; border-radius: 12.5px 0px 0px 12.5px; \"><p>Registered</p></div>"
);
//
var text PreArrival = If(
[Status] = "Pre Arrival", "<div style=\"" & $style & " background: #57a3f0; \"><p>Pre Arrival</p></div>",
If([Status]="Arrival" or [Status]="Quarantine" or [Status]="Discharged",
"<div style=\"" & $style & " background: #57a3f0; \"><p>Pre Arrival</p></div>","<div style=\"" & $style & " background: #C1C3C4; \"><p>Working</p></div>")
);
//
var text Arrival = If(
[Status] = "Arrival", "<div style=\"" & $style & " background: #57a3f0; \"><p>Arrival</p></div>",
If([Status]="Quarantine" or [Status]="Discharged",
"<div style=\"" & $style & " background: #57a3f0; \"><p>Arrival</p></div>","<div style=\"" & $style & " background: #C1C3C4; \"><p>Arrival</p></div>")
);
//
var text Quarantine= If(
[Status] = "Quarantine", "<div style=\"" & $style & " background: #57a3f0; \"><p>Quarantine</p></div>",
If([Status]="Discharged",
"<div style=\"" & $style & " background: #57a3f0; \"><p>Quaratine</p></div>","<div style=\"" & $style & " background: #C1C3C4; \"><p>Quarantine</p></div>")
);
//
var text Discharged= If(
[Status] = "Discharged", "<div style=\"" & $style & " background: #F95A5A; border-radius: 0px 12.5px 12.5px 0px; \"><p>Discharged</p></div>",
"<div style=\"" & $style & " background: #C1C3C4; border-radius: \"><p>Discharged</p></div>")

------------------------------
Tim Egerton
------------------------------
This topic has been closed for replies.

  • Registered
  • November 4, 2020
Maybe it's a copy-paste issue but in the code you shared there is a missing semicolon on the very last line.  It should be:

var text Discharged= If( [Status] = "Discharged", "<div style=\"" & $style & " background: #F95A5A; border-radius: 0px 12.5px 12.5px 0px; \"><p>Discharged</p></div>", "<div style=\"" & $style & " background: #C1C3C4; border-radius: \"><p>Discharged</p></div>");​

------------------------------
Nathan Hawe
------------------------------