2 Replies Latest reply on May 16, 2011 8:47 AM by philmodjunk

    Newbie User question: Adding photos



      Newbie User question: Adding photos


      I am a filemaker novice. I have recently made the transition across from Access, so workflows and methods are somewhat different to what I'm used to.

      I am a teacher at a high school and have used Access to administer my faculty. I'm slowly piecing together a relational database in Filemaker to replace the Access database.

      One issue I used to have in Access was including  photos (of the students). It was not possible to embed the photos into the database without bloating the file size out. With some simple scripting I was able to link the photos externally to the student data table.

      It seems that in Filemaker I can very easily add a photo field and then bring the photo in.

      Here's my question: how can I easily and quickly add the photo field for each student when I have over 1000 students in the table.

      The fields in the StudentData table is as follows:

      StudentID (unique 6 digit number, used as the primary key)



      Year Group


      Photo (container field)

      I have a folder with photos. The photos are named by StudentID. So, for example, student 060001 has a matching photo named 060001.jpg

      It's easy enough to add one photo into the table but how would I add over 1000

        • 1. Re: Newbie User question: Adding photos

          The fact that you have the jps named with the student ID is what is  going to make this easy for you.

          First make sure they are all in  the same folder.

          You are going to have to write a script to do  this for you. But once you write it, the script will do all the work.

          Basically,  here is the script you need:

          Go To Layout [Layout with students  on them]

          show all records

          set variable[$path;value=PATH TO  FILE WITHOUTFILENAME]

              For help setting the correct path to  where your photos are, add an INSERT PICTURE script step and clic  specify source file, navigate to the folder where your photos are and  pick any one. Copy and Paste from the beginning until the last "/".  Paste that into the value of the $path variable.

          Go to Record  Request [First]


          set  Varialbe[$photo;value=$path&STUDENTID&".jpg"]

          Go To  Field PHOTO

          Insert Picture (you can use the one you already added)  Clic specify source file and type $photo in the dialog box and hit ok.

          Go  To Record Request [NEXT, exit after LAST]

          END Loop

          Commit  Record Request

          AND YOU ARE DONE.

          Here is a  description of what the script is going to do:

          Go to the layout  where I want to add the photos. Show all the records, because I want to  add photos to all. All the photos are in the same folder, but they each  have a different name, so store the path to the folder in $path. Go to  the first record to make sure I don't miss any. Start a Loop because I'm  going to do the same thing for a whole lot of records. Set $photo to  combine the path to the folder, the STUDENTID that is the file name and  the extension of the file name so Filemaker know where to get it from  without me importing one by one. Go to the photo field because that is  where I'm going to put the photo in, Insert the photo that is at $photo  on my computer. Go to the next record, and when you finish with the last  one, get out of the loop. And finally commit the record...

          Hope  this helps...

          • 2. Re: Newbie User question: Adding photos

            You might also look in to Import Records | Folder option

            This is an option you can use to import an entire folder of jpegs in one go. You can most easily use this tool to import the photos into a related table and import the file name into another field in this table at the same time. At that point, using the file name to link to your original table should be a fairly simple calculation field that extracts the student ID from the file name.