2 Replies Latest reply on Jun 5, 2017 5:45 AM by clayhendrix

    Import Images with Linking File

    clayhendrix

      I have images (student id photos) in jpg format. I have a csv file that contains two fields, one contains a value from a field in the FMP database (an id) for the student and the other field is the name of the image that is related to that student. Very simple two columns: student ID and student photo filename. There are no duplicates for either of the fields in the csv.

       

      The solution is hosted by fmphosts.com. I have a container file on the layout where I want the photos to appear and some have photos that have been dragged into the container and that works fine, but I do want to overwrite the current photo with the new one.

       

      Where do I put the actual image files so FMP "find" them in the hosted environment?

       

      I can envision a script that might do this, but I've not worked with container fields in scripts before. I could certainly import the jpg filename into a field in the table, but I'm not sure how to "connect" the data in that field OR the data in the csv to the actual jpg files.

        • 1. Re: Import Images with Linking File
          erolst

          1. When importing, there is an option to update matching records; you could use that to match on student ID (make sure to Show all Records before you do) and so only import the image path into (a new field in) your table.

           

          Screen Shot 2017-06-03 at 00.08.18.png

           

          I strongly suggest creating a backup of your file before you try this.

           

           

          2. That depends on the storage type you choose. Do you want to keep the original image files and just use a reference, or store the images in the database (either internally in the file, or externally – with open or encrypted storage)?

           

          You see, this is a complex topic (and we haven't even talked about using a dedicated Image file … ).

           

          No matter what the storage type, you could write a script that uses the path information to set the image into the container using Insert Image; use a loop to do this for all records.

           

          Same backup rule applies …

          • 2. Re: Import Images with Linking File
            clayhendrix

            How do I determine the best choice: internal vs. external storage?