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
  • for color handling ->

    a!localVariables(
      local!data: {
        a!map(id: 1, date: todate("1/02/2024")),
        a!map(id: 2, date: todate("1/12/2024")),
        a!map(id: 3, date: todate("1/17/2024"))
      },
      {
        a!richTextDisplayField(labelPosition: "COLLAPSED", value: {
          a!forEach(
            items: local!data,
            expression: a!richTextItem(
            text: {concat(tointeger(today()-fv!item.date)," Days left"),char(10)},
            color: if(
              tointeger(today()-fv!item.date)<=3,
              "POSITIVE",
              if(
                tointeger(today()-fv!item.date)<=15,
                "STANDARD",
                "NEGATIVE"
              )
            )
          ))
        })
      }
    )

Children