5 Replies Latest reply on Mar 25, 2013 10:17 AM by cschul

    Inserting Pictures

    cschul

      Title

      Inserting Pictures

      Post

           I'm trying to figure out a way to import a picture into FileMaker Pro based on file name.

           I have a database in FMP, there is a field called Picture1. This field contains the filename of the picture what I want to insert. 

           Example:

           Picture1   123456.jpg

           I have a folder that has the actual picture with the same name 123456.jpg

           How do I have FMP look for the picture in the folder on my desktop based on the contents of a text field?

            

           What happened is that I get an excel file from someone and a folder with all the pictures.

            

           By the way, is there any way to stop Save dialog box coming up everytime i edit an entry using a script?

        • 1. Re: Inserting Pictures
          philmodjunk

               If you know the file path to the file, as you should with a "folder on my desktop", you can insert that specific file using a path variable.

               But if you have a whole folder of images that you intend to insert, use the Import Records | Folder option to import them all into a table in your database. You can import the images into a container field in that table and the filenames into a text field at the same time.

               You can then use the file names in your original table and this table of import images to link up your records in a relationship.

          • 3. Re: Inserting Pictures
            cschul

                 PhilModJunk,

                 This is what I first assumed to do. I guess I'm having issues around creating the relationship. I'm much more familar with Access and SQL than I am FileMaker Pro. 

                 I have a text field called "picture1" contains the filename on the database I want to import the picture into. The field on the other table is "File name". So i created a relationship between "picture1" and File Name". However, both of my container fields are greyed out and can't be selected. I tried to do a calucated and a lookup on the container field. I don't know what I'm doing wrong.

            • 4. Re: Inserting Pictures
              philmodjunk

                   You don't need two container fields only one. Neither container field should be used as match fields in your relationship. (I think that's where you see them greyed out.)

                   You have two options. Which is best depends on what data you have where in your database.

                   Option 1. Use this method if all pictures are being imported and you don't have any pictures in your original table that you want to keep.

                   Remove the container field from your original table. You do not need it.

                   If you have this relationship:

                   OriginalTable::Picture1 = ImageTable::File name

                   You can simply add the container field from Image Table directly to your OriginalTable layout and it will show the imported image just as though that field were part of your original table.

                   Option 2. Use this method if you need to combine the imported pictures with images already present in your original table.

                   Assuming the same relationship as Option 1, Immediately after importing the data, use Replace Field Contents on a layout based on your Image Table to copy the contents of the ImageTable container field into the container field of the matching original table record.

              • 5. Re: Inserting Pictures
                cschul

                     Thanks, worked perfectly.