3 Replies Latest reply on May 27, 2015 4:29 PM by philmodjunk

    Populating Container Field

    rtolliver

      Title

      Populating Container Field

      Post

      I have a FM database that I created from migrated MS Access 2010 data. There are 2 image location fields that were used to display pictures for each record, there are a total of 875 records and the pictures are on an external drive.  

      I'm trying to identify scripting steps that will use the existing image location information to create the necessary pointers needed to display the pictures in container fields.

      Thanks

       

        • 1. Re: Populating Container Field
          philmodjunk

          Do you have file paths to those files imported as text from the Access database? Or enough of such data that you could calculated the file path?

          if so, see this link on $Path variables and the script steps that use them. Once you get the filepath into such a variable, you can use it with one of the Insert script steps to insert either the file or a reference to the file into a conatiner field in a looping script to update your imported records.

          Exploring the use of a $Path Variable in Scripts

          • 2. Re: Populating Container Field
            rtolliver

            Thanks for all of the previous answers you've provided for my postings. I do have a question for you regarding your FilePathExtractor as it relates to my container file issue.  I've downloaded FilePathExtractor and used it but I don't quite see how it will help me with my 800 plus existing records. These records were imported from Access 2010 and 2 container fields were added to the table to display pictures. As part of the imported table data there are 2 text fields that have the path to pictures,

            example: 

            \\Computername\ExternalDriveName\Dir\Sub-dir\FielName.jpg

             

            I need to be able to input the correct pathname for each record.

             

            There are 2 things, the first is I'm not sure where the container field storages the file path and second how to use FilePathExtractor for this task.

            • 3. Re: Populating Container Field
              philmodjunk

              The file provides a lot of general info on the different script steps that can sue $Path variables along with specific examples of how you can extract a file path from a container field and also examples of how to set up calculations that compute a file path.

              One very useful way to use this file is to insert a file from a given location into the container field using the "store a reference" option. The calculation fields that come with the file will then show the file path and this can be a very good way to "debug" why a calculated file path is producing an error as even one character wrong can result in such errors.

              When it comes to filepaths and containers, A file path in a text field may be copied to a $path variable and used in a script to insert a file into a container field. That container field may store a file path to the  file, but it might also copy the file to a specified external storage location or it can simply embed the file (store a binary copy of the file). It's up to you to decide how to store the file.

              If you are going to use a container field (a webviewer can use a text field's file path as a URL, you can use a looping script that loops through your records and uses Insert File (or one of the other Insert steps) with a file path variable to insert the file. You'll find that you have an option to use "store a reference" in the script step and there is a storage option for the container field that can be used to set up external storage. Just don't select both "store a reference" and external storage for this process.

              The script can use set variable to set the variable's value and then the next step can be an "insert.." step to insert the file, picture, video, audio...

              But use the FilePathExtractor file to confirm that the imported file path text in your field does not need some modification to be correctly formatted to use as the $path variable's file path. (the insert method used can change the first part of the file path.)