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
14 replies
-
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
-
Many thanks
John
-
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
-
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
-
Also, John.
See this article, it may help you: https://ninoxdb.de/en/forum/technical-help-5ab8fe445fe2b42b7dd39ee7/color-of-formula-field-5ac81b476f8f216ae7f2c9dd
-
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
-
You can also display an icon instead of a color.
Use : icon("check") for example.
Best regards, Alex
-
You can aslo use the styled() element to display a field with an icon and color.
e.g. styled(field_name, "red", "warn")
-
Thanks
The icon(“check”) worked.
John
-
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
-
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
-
Hmm, I am not sure I can but I will look out for the answer from someone more knowledgeable with interest.
John
-
@Mr. K.
The link does not show icons ((
Content aside
- 3 yrs agoLast active
- 14Replies
- 6697Views