0

Text styled function

Hello,

I have a formula field:

if 'Candidats Inscrits' < 'Max. Candidats' then
"Incomplet"
else
"COMPLET"
end

But I also would like to styled my text. For example, field in red if « Incomplet » and field in green if «  COMPLET »

Thanks in advance for your help.

David. 

7 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 5 yrs ago
    • Reported - view

    ...

    styled("incomplet","red")

    else

    styled("complet","green")

    end

    should do the trick

    • David_WILLOX
    • 5 yrs ago
    • Reported - view

    Thanks for your feedback, Steven.

    But which global formula do i have to write to get the conditions togheter?

    If "condition" then "text" and "color".

    Thanks for your help.

    David.

    • Ninox partner
    • RoSoft_Steven.1
    • 5 yrs ago
    • Reported - view

    Not shure what you mean but is this working for you? This should be entered in a formula field.

    if 'Candidats Inscrits' < 'Max. Candidats' then
    styled("Incomplet","red")
    else
    styled("COMPLET","green")
    end

    Or this for colored text instead of background color:

    if 'Candidats Inscrits' < 'Max. Candidats' then
    styled("Incomplet","","red")
    else
    styled("COMPLET","","green")
    end

    • info.12
    • 5 yrs ago
    • Reported - view

    Yes, NICE. It's exactly what i need.

    Thanks for your quick help.

    Have a nice day...

    • David_WILLOX
    • 5 yrs ago
    • Reported - view

    Yes, NICE. It's exactly what i need.

    Thanks for your quick help.

    Have a nice day...

    • David_WILLOX
    • 5 yrs ago
    • Reported - view

    Other question in the same way, is it possible, with se same condition, to have not only the field but the whole row with this layout in table view?

    • Ninox partner
    • RoSoft_Steven.1
    • 5 yrs ago
    • Reported - view

    I don't think it is possible to "style" text fields or number fields.

    If it has to be, you can make duplicates of the fields in a formula field and use only these fields in a table view.

    ex.

    if 'Candidats Inscrits' < 'Max. Candidats' then
    styled('résidence',"red")
    else
    styled("résidence',"green")
    end

    Note that you can not edit formula fields. For formview, you could put them in an other tab or make them invisible.

    This way your layout is more acceptable.(pour le bien de layout)

Content aside

  • 5 yrs agoLast active
  • 7Replies
  • 3703Views