Skip 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.

Change Text Color Based on Field Parameters

Featured Replies

Hi Guys,

Quick question, I have a field, let's call it Field A, and this field has text in it.

Now, I have another field, Field B. Field B may or may not have text in it.

What I want to do is this. If Field B DOES have text of any kind in it, I want the color of the Text in Field A to change to red.

I've done this with validation from a drop down list before with other fields, but I cannot get this one to work, all it does it erase what's in Field A instead of updating the color.

Here is a sample of the calculation I'm trying.

Case ($Field B} = "*" ; TextColor ( Field A ; RGB ( 4 ; 54 ; 255 )))

Any insight or help with the Calculation would be great.

Thanks in Advance,

I don't think validation is the correct tool for this. Define Field A to auto-enter the following calculation:

Case ( IsEmpty ( Field B ) ; TextColorRemove ( Field A ) ; TextColor ( Field A ; RGB ( 4 ; 54 ; 255 ) ) )

Uncheck the "Do not replace existing value..." option.

P.S. RGB ( 4 ; 54 ; 255 ) is more blue than red.

Hi Comment,

Is there any way to change the color of text for an unstored calculated field depending on it's content? You can't modify with a script and I can't get it by putting a TextColor() statement in the calculation defenition.

Edited by Guest

"I can't get it by putting a TextColor() statement in the calculation defenition."

You should be able to.

Without even putting in a case statement to change the color yet - the following is always black.

Somthing like:

Unstored, = TextColor ( GLOBALS::cDateMain + __pk_DateID - 1; RGB ( 5; 10; 255) )

The field's formatting overrides the calculation.

Go back to the source text and remove its text colour, or set it to something other than black as a test (like green).

You're right. The field format is overwriting it. Not sure what I can do about it.

I worked around this by making another calc field that looks up the first and changes the color. A hack, but there's only 50 records.

Thanks for your help

I found out it's because the field is a date type. If you change field to a text, can change color. For a date, NG.

Is this a bug?

No Bug.

They only work on text, that is why they call them Text Formatting Functions.

HTH

Lee

  • 2 weeks later...
  • Author

Ok,

I've been messing with this and I keep coming to the same issue. The color of "Field A" does change when "Field B" has text or doesn't have text.

The only issue is that the text I had in "Field A" is replaced by a huge number, ".468398780781783 and then that numbers color will change.

What am I doing wrong?

What am I doing wrong?

Hard to tell from here. Does this work for you?

ColorText.fp7.zip

Is the field a number field, the calculation will only work on text. If is text, then Paste a copy of your calculation, or a mock up or demo of your file.

Lee

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.