Function "eq" is not working

Hi, all. I have been scratching my head as to how I can conditionally change color of the context for a markdown. For some reason, the equality function "eq" doesn't seem to compare correctly. Even though the markdown displays the column value correctly in the workpad e.g. "warn", but the switch case test lands on the default. Am I missing something? Thanks in advance.

| markdown "{{rows.0.overallStatus}}"
font={font size=48 family="'Open Sans', Helvetica, Arial, sans-serif"
switch {case if={eq "warn"} then="orange"}
{case if={eq "ok"} then="green"}

According to this
The syntax is

  fn=${getCell status | switch 
    {case if={compare eq to="up"} then=Healthy}
    {case if={compare eq to="down"} then=Unhealthy}

Try changing your syntax accordingly.

Thanks. I was able to get it working with the following syntax: -

font={font color={if condition={getCell overallStatus | eq "error"} then="red"
else if condition={getCell overallStatus | eq "warn"} then="orange"

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.