1 Reply Latest reply on Jul 30, 2014 9:35 AM by philmodjunk

    Fetch for images with relative path when import from Excell

    AlbertoMisrachi

      Title

      Fetch for images with relative path when import from Excell

      Post

           I am importing a big excel file.

           One of the columns reads the relative path to an image (images/image1.jpg, images/image2.jpg, ETC) 

           When I drag and drop the Excel into the Filemaker the column is imported as text: images/image3.jpg

           I change the file field type from text to container, and all I see is the text inside the container.

            

           Currently the .fmp12 file is in a folder, inside this folder I have a folder named "images" where the .jpg files are located.

            

           How can I make the FM go fetch and load the corresponding images in the containers?

            

           Thanks

        • 1. Re: Fetch for images with relative path when import from Excell
          philmodjunk

               "relative" to what?

               In FileMaker terms a "relative path" is a path that is relative to the location of the database file so if you specify just a file name, you are specifying the path to the database file as the location for the named file. If you include a folder name, it refers to a folder located in the same directory as the database file.

               So is this a path relative to the excel file?

               If so, you'll need to get the file path to that excel file in one way or another. One way is to use Insert File to insert the excel file into a container field with the "store a reference" option enabled. Other methods are also possible.

               Once you have that file path, you can combine that with the imported file path text for each image file to set a $Path variable to a file and a script that loops through your records can compute that $Path and then use insert file, or one of the other Insert options to insert the file into a container field.

               You may find this thread and exploration file on $Path variables useful: Exploring the use of a $Path Variable in Scripts