Skip to main content
jaideepb0002
November 11, 2022
Question

How to colour my Decimal field based on its value

  • November 11, 2022
  • 7 replies
  • 0 views

Hi, I have a decimal field on my interface that I want to colour based on its value..something like

if =8: then green

if <>8: then blue

How do I do that?? 

I know how to colour a text field.

Please help

thanks

jaideep

7 replies

amans0009
November 11, 2022

I want to know "How to color a text field?" , please share if you know.

jaideepb0002
November 12, 2022

Hi Aman, sorry my bad.  I meant richTextDisplayField..something that Chris is suggesting below. 

thanks for looking though

stefanhelzle0001
Brainy
November 11, 2022

Text fields do not support colors.

Instead you could use a side-by-side layout to place an icon nearby and change its color based on some conditions.

jaideepb0002
November 12, 2022

yeah thanks Stefan..i think I will have to do it to keep the UI look simple. Currently I am doing a validation message but that's not looking good

stefanhelzle0001
Brainy
November 12, 2022

I recommend to stay to Appian OOTB as much as possible. Most approaches to customize things will get you into trouble sooner or later. Also keep in mind that our clients typically run multiple apps and you would have to keep these customizations in sync across all apps and delivery teams.

csteward
November 11, 2022

Additionally, if you can change to a!richTextDisplayField() you can utilize color-coded text values:

a!localVariables(
  local!values: {7.55,8,9.22},
  
  {
    a!forEach(
      items: local!values,
      expression: a!richTextDisplayField(
        value: a!richTextItem(
          text: fv!item,
          color: if(fv!item=8,"#3DDD2A","#0000FF")
        )
      )
    )
  }
)

jaideepb0002
November 12, 2022

Thanks Chris..okay so this also looks like another option. I need to try it