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.

Formatting a range of fields?

Featured Replies

I have the following script I'm using to determine the textColor of a field based on its contents:

If [ testData::r001 = "√" ]

Set Field [ testData::r001; TextColor ( testData::r001 ; RGB ( 25 ; 125 ; 50 ) ) ]

Else

Set Field [ testData::r001; TextColor ( testData::r001 ; RGB ( 235 ; 30 ; 35 ) ) ]

End If

You'll note that I'm applying this to field "r001"...I have 100 of these types of fields ("r001" - "r100"). The question is can I apply this script to all of them without having to repeat the script 100 times?

Thanks in advance for any assistance.

How is the script being triggered?

Now that I think about it, you should probably just make each field an auto enter calc with "do not replace existing value for field (if any)" unchecked;

If (

r001 = "√";

TextColor ( r001 ; RGB ( 25 ; 125 ; 50 ) );

TextColor ( r001 ; RGB ( 235 ; 30 ; 35 ) )

)

Or

TextColor( yourFieldName; If( yourFieldName = "√"; 1670450; 15408675 ) )

Queue could you explain 1670450; 15408675. This is an alternative way to select color instead of 000;000;000?

RGB( x; y; z ) = 256^2 * x + 256 * y + z

It is merely the decimal equivalent of the quadratic represented as RGB( ).

  • Author

Sorry...but I'm not sure I'm understanding any of the responses so far. Perhaps I worded my question poorly. I'm not having trouble getting the field to become the color I desire using the script I gave in the original post. What I was curious about was if there was a way to apply the textColor formatting to a group or range of fields without having to copy/paste the script 100 times and replace the field names.

Yes, see attached.

Slobey was suggesting that you make it easier on yourself and use an auto-enter calc with 'do not replace existing value' deselected for each of your rXXX fields. You will have to update your existing records. But any new ones will automatically change the color of the text appropriately when data is entered or modified.

mKirk.zip

  • Author

Ah!

It was the...

TextColor( GetField(Get(ActiveFieldName)); If( Get(ActiveFieldContents) = "√"; RGB ( 25 ; 125 ; 50 ); RGB ( 235 ; 30 ; 35 ) ) )

...in a loop that I was missing. Thanks!

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.