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

Calculation based on container Field

Featured Replies

FMP 7 (OSX and winxp)

I have a text field that is based on the filename of the image in the container field: text_field_1=Product_Image.

Works great in osx. It gives me the file name as soon as I place an image in the container field.

My problem is that it doesn't work under winxp

the result of the exact same field is: ?

It doesn't give me anything, just "?". I have tried exporting the data and it just exports a "?" as well. Any ideas.

The text field is a calculation so it updates automatically when I change the container field contents.

Thank you in advance.

Jeffrey Duncan

[email protected]

Please show us the calculation that gets the filename into the text field. Is the calc unstored so it can update?

FileMaker treats backslashes in calculations as an escape character, your calc may be misinterpreting the in Windows file paths as an escape character.

  • Author

Nothing complex here:

If (IsEmpty(Product Image);"image_coming_soon.gif" ; "product_images/" & v_manufacturers_name & "/" & Product Image )

I get this on Mac OS X:

product_images/Freud/freud1013.jpg

I get this on WinXP (with the same database)???

product_images/Freud/?

I have tried removing the if statement and just using "product_image" - this works fine on os x, not on winxp.

Any ideas?

How is the field "Product Image" calculated or set?

  • Author

Product_image is the container field. I right-click on the field to "insert image".

Thank you for your help

Have you tried:

GetAsText(Product Image)

Also, as Cyborg Sam pointed out, Windows uses , not / like Mac when naming paths. This could have something to do with the inability to export.

  • Author

I have tried it numerous ways.

Let me clarify:

Product_Image is a container file. This is where I place my images in the database.

v_products_image is the calculation that displays the name of the image file in Product_image.

to simplify things, i used the following calculation:

v_products_image = Product_Image (calculation result must be text)

This works under osx but not under winxp. give it a try. Just two simple fields. In WinXP it gives me a ? - in OSX it shows the image filename.

Maybe you should use the explicit GetAsText ( Product_Image ), as Kent suggested. I also see that I can get away with just a calculation with the result text on a Mac. But it's kind of fuzzy programming. Maybe the PC requires an explicit coercion?

Maybe the PC requires an explicit coercion?

What does "explicit coercion" mean?

  • Author

I was using GetAsText originally. When I found that it performed in the same manner as just using the field name I simplified the calculation and got rid of GetAsText.

If you have a WinXP installation, give it a shot. I would love to have it work for someone.

Unless I'm missing something, using GetAsText() will do what you want on Windows and on Mac.

Here's an example I created in Windows and tested on a Mac.

GetImageName.zip

explicit type coercion: A programming construct (syntax) to specify that an expression's value should be converted to a different type. From: Free On-line Dictionary of Computing

Thanks, Fenton! I bookmarked the dictionary site for future reference.

Create an account or sign in to comment

Important Information

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

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.