How to show date difference in record type based on condition

Hi,

I want to display the difference between today's date and created date in record type as an integer value. Further, I want to show the value in certain colors based on condition (like if the values is less than 3 then green color; if the values are in between 3 and 5 then yellow; and if the values are greater than 5 then red). This values will only come when the status is not completed.

Can somebody guide me?.

Many thank,

  Discussion posts and replies are publicly visible

Parents Reply
  • Hi Amaan,

    Thank you for providing your insights. 

    I have modified the code little bit and now it is giving me the desired result.

    a!localVariables(
      local!values: {if(
        tointeger(rf!riskAssessmentStatus.id)<5,
        tointeger(today()-rf!createdOn),"NA"
      )},
      {
        a!forEach(
          items: local!values,
          expression: a!richTextItem(
            text: fv!item,
            color: if(
              fv!item = "NA","STANDARD",
              if(
                fv!item >= 6, "NEGATIVE",
                if(
                  fv!item <= 3, "POSITIVE","#FFFF00"
                )
              )
            )
          )
        )
      }
    )

Children