0

Icon and Colour field types

Is it possible to set the value of these field types within a formula?

As an example, I would like to set an icon field to a green tick icon if something is true or a blue cross if false.

Thanks

John Dempsey 

14replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi John, 

    In order to do that you can use a formula field and the styled function in a formula like follows: 

     

    styled(Client.'First Name', if Client.'First Name' like "Dan" then

    "yellow"

    else

    "grey"

    end, if Client.'First Name' like "Ho" then

    "res"

    else

    "blue"

    end, if Client.'Last Name' like "Me" then

    "shot"

    else

    "plant"

    end)

     

    The names of the available icons you can find in the database 01_iconset.ninox here:

    https://www.dropbox.com/sh/p3bafxtwfvkw2ik/AAAtlHV-MAF7ZFq02iupNxmZa?dl=0 

    Best Jörg

    Like
  • Many thanks

    John

    Like
  • I am still having trouble understanding this.

    I have two date fields in a table called 'bookings' and I want to display the icon "check" if the field 'expiry date' is <= field 'departure date' else the icon "x"

    Do I put the style formula in the trigger on update section of an icon type field type or is it the formula field type itself that displays the required icon?

    What would be the code to enter?

    Many thanks 

    John

    Like
    • S Moore
    • SMoore
    • 4 yrs ago
    • Reported - view

    I also have a table named Products/Services, I have a color coded choice field named "Type" I would like the color value of my type field to color code a text box the same color as that one. The text box is named "Name"

     

    Please help

    Like
    • S Moore
    • SMoore
    • 4 yrs ago
    • Reported - view
  • Thanks S.Moore but that displays text and sets the colour whereas I am trying to select a specific icon to be displayed depending on the result of a formula.

    John

    Like
    • Support
    • Support
    • 4 yrs ago
    • Reported - view

    You can also display an icon instead of a color.

    Use : icon("check") for example.

    Best regards, Alex

    Like
    • Support
    • Support
    • 4 yrs ago
    • Reported - view

    You can aslo use the styled() element to display a field with an icon and color.

    e.g. styled(field_name, "red", "warn")

    Like
  • Thanks

    The icon(“check”) worked.

    John

    Like
  • Err, well almost!

    I have 4 of these status fields, 3 of them display the icon formatted on the left of the display box and 1 centered. How do I get them all centered?

     

    John

    Like
    • S Moore
    • SMoore
    • 4 yrs ago
    • Reported - view

    I also have a table named Products/Services, I have a color coded choice field named "Type" I would like the color value of my type field to color code a text box the same color as that one. The text box is named "Name"

     

    Please help

    Like
  • Hmm, I am not sure I can but I will look out for the answer from someone more knowledgeable with interest.

     

    John

    Like
    • Agassi
    • Agassi
    • 11 mths ago
    • Reported - view

    @Mr. K.

    The link does not show icons ((

    Like
Like Follow
  • 11 mths agoLast active
  • 14Replies
  • 6437Views