AnsweredAssumed Answered

Filemaker 16 TextColor Function

Question asked by jcpython on Nov 12, 2017
Latest reply on Nov 14, 2017 by user19752

Hey everyone, imbeen searching hours and maybe im just not seeing the answer before my eyes or Filemaker doesnt have this feature. I'm using FMPro 16 on windows 10.


so i have a database with a MAIN table used for storing Cryptocurrency information. each currency table record has a text field called currencySymbol which is the 3 letter code for that currency.


My question is UI related and hopefully i can explain this properly.


On my layout for Currencies i have the currency symbol in a text field or label (ivetried both) in a portal list. when i click one it bring up data for that currency on the same layout via relationship.

all i want to do is have another field in the currency table like a dropdown with a list of colors, and each currency can be assigned its own unique color. so the list of currency symbol labels in the portal are all white text but as soon as i click on a currency, iam trying to style the text fields, the text labels to match the color of that currency record


its possible i know, just about everything is in filemaker lol, there is always a impractical way to achive the task, what im trying to avoid is using over a thousand conditional formating steps, or over a thousand HideObjectWhen calculations, that would clutter up my layout and there are already nearly 2 thousand records and more to come everyday.


My first attempt (tried it in many combinations and none worked) was to ad a field to the table called CurrencyColor and it was a field where i could enter "#FF0000" or similar for each individual record.then another field i added called HexToRGB, which was a calculation field (result was text) The calculation used is :


"RGB (" & cf_convertHexRGB ( CurrencyColor; ";") & ")"


The result looks like this:


RGB (255;0;0)


Another calc field (unstored) called SymbolColored has a calc as follows:


TextColor ( Coin Symbol; HexToRGB )


NOTE: the "(" & ")" where removed because they are included in the calc field result HexToRGB, otherwise fm wouldnt let me use the field  HexToRGB ...Meaning i wasnt allowed to save it as ---> TextColor ( Coin Symbol; RGB (HexToRGB) )


So far the only way i can get the textcolor function to work as i need is to se the following code

TextColor ( Coin Symbol; RGB ( 255 ; 0 ; 255)), however its not at all as flexible as i need.


the other thing i did was in layout more i added a conditional formatting step to one text field and 4 text labels to match the color specified in one records field CurrencyColor, it was a huge pain to do and will need to be done over a thousand times and probably daily as the new cryptocurrencies are always being created.


If anyone knows a better way or has any suggestions i would love to hear from you guys, and i appreciate all the efforts put in trying to understand what i attempted to explain above lol.




PS. I have no idea where to publish this post, been a while since i been online here and things have changed a lot. I hope i got it in the right place.