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.

Calc - unexpected deletion of existing values

Featured Replies

I was experimenting (in TEST, thankfully) with a TEXT field that had a new requirement to change color of certain values to RED.

I changed the field type to CALCULATION and set up a CASE statement to do the color change:

CASE(LeftWords(myfieldname;1)="myfieldvalue"; TextColor ("myfieldvalue"; RGB (255; 0; 0)))

FileMaker warned me that this would cause it to re-evaluate all existing values.

WHAT I EXPECTED: All the target values to be changed to RED, and all other values to be evaluated and then left alone.

WHAT HAPPENED: The target values were all changed to RED. All other values were DELETED.

I only had the CASE set to act on the one value as shown above. I did not specify any other action (like bypass if 'not').

[color:red]MY QUESTION: Is 'delete existing values' if no specific handling given a normal behavior of FileMaker? If so, how do I specify a catch-all 'not' clause to protect those values?

I want to see if I am on to something I can use to diagnose an unrelated transient problem we're having. Several fields in our database routinely have data 'disappear' - I suspect some of the legacy calculations in it may be causing the data to disappear based on what I observed in my test.

(We are trying to unravel what 2 DBAs left us without benefit of documentation).

Thank you.

When you want to test a calculation like that, just create a temp field to test it in, before you use it in the actual field. i.e. c_myfieldvalue.

You have to give it a color for those records that don't match your calculation.

Try:

Case(LeftWords(myfieldvalue;1)="myfieldvalue"; TextColor ("myfieldvalue"; RGB (255; 0; 0)); TextColor ( myfieldvalue ; RGB ( 0 ; 0 ; 0 ) ))

HTH

Lee

Edited by Guest

  • Author

Thank you - that this is normal behavior is really scary stuff - Having worked with other database products, I'd consider behavior like this a BUG. :eeek:

Calculation fields are for calculating - not for storing data. I am surprised Filemaker didn't erase all your data in that field - that **IS** a bug, IMHO. In any case, I don't see how you're going to modify any of it, if the need arises.

Thank you - that this is normal behavior is really scary stuff - Having worked with other database products, I'd consider behavior like this a BUG.

Why, it did exactly what you told it. If found the matching data, and changed it to Red. It even tried to warn you that you would loose the data by changing the field type, but you went merrily along your way an changed it to a calculation.

Before calling something a bug, you really should learn the product.

Lee

Edited by Guest

krempch, you only specified data if it matched your condition. You need to add a default result if it does not match.

CASE (

LeftWords(myfieldnam e;1)="myfieldvalue";

TextColor ("myfieldvalue"; RGB (255; 0; 0));

myfieldname

)

or, better I think, since these format changes tend to be "sticky,"

CASE (

LeftWords(myfieldnam e;1)="myfieldvalue";

TextColor ("myfieldvalue"; RGB (255; 0; 0));

TextFormatRemove (myfieldname)

)

Edited by Guest

  • Author

Why, it did exactly what you told it. If found the matching data, and changed it to Red. It even tried to warn you that you would loose the data by changing the field type, but you went merrily along your way an changed it to a calculation.

Before calling something a bug, you really should learn the product.

Lee

Changes to data values it wasn't asked to evaluate that are not specified is a BUG. Changing the field type had nothing to do with what happened.

As far as changing the field type and calc fields being used to store data I will agree with the post from Comment. If this is what you were trying to say, fine, but that's not how you came across, smart-alek.

  • Author

Thank you for providing a beginner like me the needed steps.

As far as changing the field type and calc fields being used to store data I will agree with the post from Comment.

I don't happen to agree with comment here, but then I accept things the way FileMaker does them because I don't have his vast background.

If this is what you were trying to say, fine, but that's not how you came across, smart-alek.

Sorry if I came across that way to you. But, I lose my patients sometimes when new users call everything they don't understand, a BUG.

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.