Jump to content

Container field = referenced JPG?

This topic is 6597 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm trying to do something very simple (I believe with FM Pro 7 on the Mac) and I think I need containers. I've inserted images into containers manually, but I'd like FM to do it 'on the fly'.

I have a directory of 'tif' files at the same level as the current filemaker pro database file. (I could easily convert these all the jpgs or PICTs if necessary)

The names of the files match a field called 'product_id' in the filemaker database, with a ".tif" or optionally ".jpg" at the end. Example a value in product_id might be "sample" and there is a corresponding image file called "sample.jpg" in the relative path path ../catalog/images/

I would like to simply have filemaker reference these files by using the value in the "product_id" field, concatenate it to "sample.jpg" or such, and show that picture. Something akin to relative links in web pages. Is something like this simple in FM?

Thanks for any advice.


Link to comment
Share on other sites

Use a calculation with a container result

"image:../catalog/images/" & product_id & ".jpg"

On Windows, it's image:../catalog/images..., so the Mac syntax may not be exactly correct. Someone else will have to verify that, though.

Link to comment
Share on other sites

It can be done, but it takes several script steps. The Insert File step requires a fixed filename. So you have to first concatenate product_id with sample.jpg, then use the Send Event script step to copy that file to the default file (what you specify in the Insert File step) by means of a batch routine. Then you run Insert File, and voila your container field will be filled with the right file.

Link to comment
Share on other sites

I'm trying to do this as well.

So I already have a field called "pictureData" - the value is something like "1209.jpg"

I have a folder in the same directory called "pix'. So first I tried Que's solution by making a container field "picture" with a calculation of - "image: ../pix/" & picture


Can you tell me where I'm going wrong?


Link to comment
Share on other sites

oops... nevermind....

I just created two new fields in my import stack - "fileName" and "pathname" along with the "picture" container field

I then imported the .jpgs into FM7 with import folder into a table -

and lined up the "filename" -" fileName" and "pathname" - "pathname"

and that was it.... then i needed to "see" the pictures in the right place with the data so i made a relationship between the two.

Link to comment
Share on other sites

This topic is 6597 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

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