# Conditional Formatting on a Field that is on many layout...is there a better way?

**URL:** <https://the.fmsoup.org/t/conditional-formatting-on-a-field-that-is-on-many-layout-is-there-a-better-way/4943>\
**Category:** Floating Topics\
**Created:** [July 9, 2025, 3:27pm UTC](https://the.fmsoup.org/t/conditional-formatting-on-a-field-that-is-on-many-layout-is-there-a-better-way/4943 "2025-07-09T15:27:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonywhitelive](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/tonywhitelive/32/208_2.png) [@tonywhitelive](https://the.fmsoup.org/u/tonywhitelive)\
**Post date:** [July 9, 2025, 3:27pm UTC](https://the.fmsoup.org/t/conditional-formatting-on-a-field-that-is-on-many-layout-is-there-a-better-way/4943/1 "2025-07-09T15:27:55Z")

</div>

I have a project where there is Conditional Formatting on a Layout\_Field (named "Status") that is on approximately 30 Layouts.

The Conditional Formatting is based on the possible values in the field. The business has changed such that one value is NOT valid going forward and another value is now valid.

I could update the Conditional Formatting on 30 Layout\_Fields...or...I could replace Conditional Formatting with a way that is 30x as DRY (Don't Repeat Yourself) and has other advantages (see below).

Please note that the notes and screen shots below are representative of the issue, and are based on code in my test system, not the customer project.

[1] Add a field named **Status\_Color\_sCR** , that makes use of a Custom Function...

> **[FileMaker Custom Function: png1x1 ( hex\_string )](https://www.briandunning.com/cf/2456)**
>
> Used to set a container field to a 1x1 .png

# png1x1 ( hex\_string )

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/6/63edfeb85ff7081d54507ce0ad93b60e10d85072.jpeg)

Place the Status\_Color\_sCR Field underneath Status Field and turn off the Fill on the Status Field.  
I like to size Status\_Color\_sCR larger than Status Field so that color shows even when you are clicked into the Status Field (an advantage).

[2] Add a Field \> Auto-Enter calculation to the "Status" Field.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/c/c61b645c301d32213da1010fedfbe7547cc5c2f0.jpeg)

// Self by itself seems to remove text formatting.  
// make sure to remove text formatting elsewhere, as needed.

The [2] techniques above let me replicate all of the Conditional Formatting options except Icon Color, which is not part of a Field and are therefore a challenge for a different use case.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/d/dbdce28b8171666a133a32003a5ef7e184b44e6f.jpeg)

Lightly tested so far.  
Not using WebDirect on this project.  
Have fun!

---

<div class="post-metadata">

**Author:** ![tonywhitelive](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/tonywhitelive/32/208_2.png) [@tonywhitelive](https://the.fmsoup.org/u/tonywhitelive)\
**Post date:** [July 21, 2025, 10:49pm UTC](https://the.fmsoup.org/t/conditional-formatting-on-a-field-that-is-on-many-layout-is-there-a-better-way/4943/2 "2025-07-21T22:49:43Z")

</div>

// this might be better  
Case (  
Self = "On Hold" ; TextStyleAdd ( Self ; Strikethrough ) ;  
TextFormatRemove ( Self )  
)

---

<div class="post-metadata">

**Author:** ![mipiano](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/mipiano/32/1074_2.png) [@mipiano](https://the.fmsoup.org/u/mipiano)\
**Post date:** [July 22, 2025, 12:06pm UTC](https://the.fmsoup.org/t/conditional-formatting-on-a-field-that-is-on-many-layout-is-there-a-better-way/4943/3 "2025-07-22T12:06:22Z")

</div>

I actually use virtually the same container technique to allow users to select a primary color from a number of colors.  
The text above such a colored container has a single conditional formatting that checks the brightness of the color and changes the text from black to white if necessary.

I get icons for buttons from an icon font. This allows me to control the icon color as well.

---

<div class="post-metadata">

**Author:** ![rivet](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/rivet/32/1727_2.png) [@rivet](https://the.fmsoup.org/u/rivet)\
**Post date:** [July 22, 2025, 2:21pm UTC](https://the.fmsoup.org/t/conditional-formatting-on-a-field-that-is-on-many-layout-is-there-a-better-way/4943/4 "2025-07-22T14:21:20Z")

</div>

here is another technique: [Dynamic background colour](https://the.fmsoup.org/t/dynamic-background-colour/4048). This method can be implemented entirely within a single field, eliminating the need for conditional formatting.

1. **Create a calculated two-line text value**

```auto
TextColor ( "status" ; RGB ( x ; x ; x ) ) &¶&
TextColor ( "██████" ; RGB ( x ; x ; x ) )

```

1. **Use a custom function** to control the color dynamically based on your logic

2. **On the layout** , set the line height of the field to a small value (e.g. 0.2) so that the two lines overlap, creating the appearance of a colored background behind the text.
