Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculation to change text colour

Featured Replies

  • Newbies

Hi, I'm new to this forum and have a (probably) simple question!

I know FM7 has the ability to change text colour depending on an answer using a calculation. I would like simply to change the results of 'PO Received' if "no" to red and "yes" to green in the field. Every time I try I get messages telling me I have too many or too few '(' ')' I know I'm doing something wrong. Can anyone help me please?

Thanks

Lorraine

ps - I have searched the forum but couldn't find any topics relevant.

Hi simpson,

If you look well you will find the answer in this forum. But to save you some time the calc should be something like this:

Case(PO received= "No"; red; PO received= "Yes"; green)

(where red / green are container fields with option "global")

Good luck!

or here is another one using TextColor:

Case (PO received= "No"; TextColor(PO received;RGB(255;0;0));PO received= "Yes"; TextColor(PO received;RGB(0;255;0)))

  • Author
  • Newbies

Hi,

I've tried using the calculation and it is accepted but the text colour doesn't change when I try it out. Do I need to do something with the field to allow this to happen?

Lorraine

If you use a number format in the layout it will suppress the color changes in the calculation.

hmm... that sounds weird. the only situation i know of that will prevent TextColor from working is if u use the Number Format to format the particular field in some cases.

mind sending a small file illustrating ur problem...? crazy.gif

  • Author
  • Newbies

I had my field set as a text file since it will only ever contain text. I have attached an example of my problem. I hope you can help.

Thanks

Lorraine

textcolourexample.zip

fixed... i did 3 things..

1. uncheck the "Do not replace existing value for field..." because if u use TextColor, it's the same as replacing the existing value with a colored text.

2. fixed ur calculation code to the one that i gave u above

3. fixed the value list value "Yes " to "Yes"... that blank space does matter...

works now :-)

textcolourexample.zip

  • Author
  • Newbies

It works, thank you SO much!!!

no problem smile.gif

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.