TextFormatRemove() and text style manipulation

Beginner

Use TextFormatRemove() to strip character-level formatting from text values and understand how FileMaker stores text styles in field data.

What you'll learn

  • How FileMaker stores character-level formatting in text fields
  • How to strip formatting with TextFormatRemove()
  • How text formatting affects calculations and comparisons
  • How to apply formatting programmatically with TextStyleAdd()

FileMaker text fields can store character-level formatting -- bold, italic, color, font, size -- embedded in the field value alongside the text content. When a text value carries hidden formatting, comparisons and concatenations can produce unexpected results. TextFormatRemove() strips all character-level styles, returning the plain text string.

1/3
1

Why formatting causes comparison problems

If a user pastes bold text into a field, the field value contains both the text and embedded styling. When you compare that value to a literal string, the comparison may fail even though the visible text matches.

FileMaker Script
// Field contains "Active" with bold formatting embedded
// This comparison may return false:
Contacts::Status = "Active"

// Strip formatting before comparing:
TextFormatRemove ( Contacts::Status ) = "Active"  // reliable

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo