2 Replies Latest reply on Oct 15, 2010 3:07 PM by philmodjunk

    Creating one record for two or more tables.

    MichaelShealy

      Summary

      Creating one record for two or more tables.

      Product

      FileMaker Pro

      Version

      11

      Operating system version

      Windows XP

      Description of the issue

      I’m building a database that has multiple tables with relationships. If I input the data, using a form, there is no issue. But when I import the info directly in to the main table, it doesn’t create records in the related tables. This is a big issue when trying to line up data when merging.

        • 1. Re: Creating one record for two or more tables.
          philmodjunk

          How could it create records in the related tables? How would FileMaker know to create 1, 2, 3 or x related records for each record imported into the main table? What data, other than the foreign key could it import into the related tables?

          In FileMaker, you import data one table at a time and you can do this by hand or  through a script. To do what I am understanding you to want, you import the records from the main table of the source file into the main table of the target file and then from a related table in the source file to the corresponding related table in the target file. You then continue this process until you have imported all the data you want to import.

          • 2. Re: Creating one record for two or more tables.
            philmodjunk

            I'd need to know more about how the data is set up in the spreadsheet to answer more specifically to what you are trying to do.

            In general, you can import from a spreadsheet into Table A, selecting the fields that belong in the parent record. You can then perform a second import of the same spreadsheet into Table B, selecting the fields that should go into Table B as long as you also are able to import the column that has a value that can be used as a primary key to link the records in Table A to related records in Table B.

            Example, you have this spreadsheet:

            PrimaryKey    Name     Address
            1                    John       555 somewhere drive
            2                    Jane       333 anywhere street

            You want to import the data in to a "Names" table and also an "addresses" table.

            Go to the layout for the "Name" table and select Import Records to import records from the spreadsheet. Select the first and second columns to import so that you import the primary key and the name. Now switch to the layout for Addresses and import again, this time importing from columns 1 and 3. If you have defined a relationship in the database to link the primary key field of the Names table to foreign key field of the addressses table (where you imported the number from column 1), you now have your data imported and linked.