4 Replies Latest reply on Jul 10, 2012 8:13 AM by igeekUK

    Copying Value Lists from one database to another

    igeekUK

      Title

      Copying Value Lists from one database to another

      Post

      Hello all

      You might find this useful - a script to copy Value Lists between databases.

      regards

      The igeeks

      http://www.igeek.co.uk/blog/34/Copying-Value-Lists-in-FileMaker.html

        • 1. Re: Copying Value Lists from one database to another
          philmodjunk

          Will this work if the file from which you copy the values is closed at the time you run the script?

          I can see the script builds a list of values in your variable with the value list name first, then the values of that list following and a separator to mark the end of each value list.

          But then what do you do with this master list of all value lists in a global variable?

          I can see some "design report" type uses for this, but can get the same in much easier to read fashion using the Database Design Report using FileMaker Advanced.

          I'm being a bit picky, but I'd say your script copies the values of all value lists in a file to another file, it doesn't copy the value list from one file to another as it doesn't produce functional value lists in the other file.

          • 2. Re: Copying Value Lists from one database to another
            igeekUK

            Hi

            In answer to your questions : 

            1. Good point, yes, both files need to be open when the script is run.

            2. As I state in the blog, you need to grab the data from the global variable and manipulate it as required (eg as it says, copy it to a text editor and use it to create value lists as required).

            3. Yes you can use the DDR facilty in FM Adv if you wish (presuming you have Adv) - the advantage here is that all of the value list titles and values are in a single, clearly organised location and in lists rather than lines. Copying from the DDR requires replacing the commas between the value list items with carriage returns - not difficult but I'd suggest that this is easier (espcially with lots of large value lists).

            You're quite right, I'm not copying a value list from one file to another (I thought that was clear in the blog) but the title at least is misleading - sorry about that, I'll adjust the blog.

             

            Thanks for your comments!

            • 3. Re: Copying Value Lists from one database to another
              philmodjunk

              I suggest a refinement that can often make setting up the new value lists easier in the new fileMaker file.

              Load the values, without the value list name into a text field. It can be a global text field as you can use one field for multiple value lists.

              Use export field contents to export the values as text to a text file.

              In the new file, use import records with the new table option to import the records into a new table.

              Set up the new value list with the specify values from a field option to draw values from the new table.

              This method, but without using a script, has been previously described here: Converting a custom value list into a table based value list

              A fusion of the two ideas might be especially useful.

              • 4. Re: Copying Value Lists from one database to another
                igeekUK

                Yes, that's a neat way of doing things - good suggestion.