Discussions

Expand all | Collapse all

Formula RTF - Syntax Error

  • 1.  Formula RTF - Syntax Error

    Posted 25 days ago
    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
    ------------------------------


  • 2.  RE: Formula RTF - Syntax Error

    Posted 24 days ago
    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
    ------------------------------



  • 3.  RE: Formula RTF - Syntax Error

    Posted 24 days ago
    Hi Nathan,

    Thanks for the reply. I thought that too but I get this syntax error when I add the semi colon.



    ------------------------------
    Tim Egerton
    ------------------------------



  • 4.  RE: Formula RTF - Syntax Error

    Posted 24 days ago
    I don't know that it would cause this error, but I did notice you've got missing CSS in the ELSE statement on that one.

    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>");​

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------



  • 5.  RE: Formula RTF - Syntax Error

    Posted 24 days ago
    Try ending with ));

    ------------------------------
    Adam Keever
    ------------------------------