13 Replies Latest reply on Mar 9, 2017 7:10 AM by sdurante

    I can't select a different target table for import

    IzzyMcCarthy

      Title

      I can't select a different target table for import

      Post

                                                                                                                                                                                   
                          To import the data into                     In the Target drop-down list, choose
                           An existing table                      A table name
                           A new table                      New Table

            

      When importing, it automatically chooses one table as the target table, but I want to be able to select a different table from the drop down list. All the other tables in the drop-down list are 'greyed out', which only leaves me with the option of one table (current) or create new table). 

      How can I change it? What am I doing wrong? 

      Thanks in advance. 

        • 1. Re: I can't select a different target table for import
          philmodjunk

               When doing a manual data import, you are limited to the target table specified by the current layout. To import records into a different layout, first go to a layout based on that table. Either that or use a script to import your records.

          • 2. Re: I can't select a different target table for import
            sdurante

            Go to Layouts, Layout Setup, select the target table from "show records from," and the next time you import it'll go to that table.

            • 3. Re: I can't select a different target table for import
              philmodjunk

              Yes but you've just altered the design of your current layout to refer to data from another source. Not only might that keep the layout from correctly accessing data, but you might not be able to correctly evaluate the results of your import.

               

              Better to change to a layout based on the correct table.

              • 4. Re: I can't select a different target table for import
                sdurante

                Now I'm confused. Presumably you need to change the target table for the import for a reason. Once the the data is in your database, it's accessible from any layout. No?

                • 5. Re: I can't select a different target table for import
                  philmodjunk

                  It is not. For every layout, you use that drop down to specify a "context" for that layout. The layout can directly access any data in the table of that one table occurrence (a table occurrence is a box in the relationships graph). It can then indirectly reference data from other tables only as is allowed by the relationships defined for that table occurrence. Any field objects that you add to the layout will either directly reference fields in the table specified in show records from or will refer to data from a related table--a table linked to the current table's table occurrence.

                   

                  Tutorial: What are Table Occurrences?

                  • 6. Re: I can't select a different target table for import
                    sdurante

                    Mmmm.
                    I can create/edit any layout using any fields from any table.
                    Again, I have to ask why are you trying to change the target table for a specific import.

                    • 7. Re: I can't select a different target table for import
                      philmodjunk

                      I am most definitely not changing the target table. I am selecting a layout that provides the correct table context for the import. This is required in order to specify the correct target table and also (I am guessing this is why the FileMaker Engineers set it up this way) so that you can then see and inspect the records created by the import.

                      I can create/edit any layout using any fields from any table.

                      Sorry, but this is not correct. While you add layout objects from any table occurrence (not table) in your file, once you enter Browse mode, only those fields selected from a related table occurrence will be able to display data and be editable. Field objects that specify an unrelated table occurrence as their source will display an error message and be useless.

                       

                      The exception to this are those special purpose fields that have been defined to have global storage. Those fields may be accessed from any layout in your file.

                       

                      Please note that layouts, tables and table occurrences may have the same name, but they are not the same thing. FileMaker makes this additionally confusing by referring to "tables" in most contexts where it actually refers to a "table occurrence". Understanding how to use table occurrences is a crucial step in learning how to effectively design a solution using FileMaker.

                       

                      Tutorial: What are Table Occurrences?

                      • 8. Re: I can't select a different target table for import
                        sdurante

                        Okay. That was useful. (My use of "table" above should be read as "table occurrence.") Thanks.

                         

                        I re-read your original question. I answered it.

                         

                        As for,

                        I can create/edit any layout using any fields from any table.

                                philmodjunk said: Sorry, but this is not correct.

                         

                        I do it all the time.
                        As to specifying what table occurrence is attached to a specific layout, if you want to use a layout to show different table occurrences, make a duplicate of the layout, rename it and attach the table occurrence you want (from Layout setup). That is how any layout can be used to show any record from any table occurrence.

                        • 9. Re: I can't select a different target table for import
                          BruceRobertson

                          That is a quite extremely incomplete answer.

                          You will also need to modify or entirely replace all objects on this new layout.

                          Fields; buttons; portals; etc.

                          • 10. Re: I can't select a different target table for import
                            philmodjunk

                            Here is a simple layout

                            LayoutBefore.png

                            After going into layout set up and selecting an unrelated Table Occurrence, I get:

                            LayoutAfter.png

                            And if I now tried to import records from this layout, I could import records into the layout's newly specified table, but I would not be able to see any of the data in any of the fields. So why on earth would I do that just to get the correct table as my target for the import?

                             

                            If I used the field tool to add fields to this layout from an unrelated table, I'd get the same result. So NO you cannot simply add fields from any table to your layout and get something useful. As Bruce stated, you then have to edit your entire layout to get it to work for the new table occurrence if you change table occurrences.

                            • 11. Re: I can't select a different target table for import
                              sdurante

                              Ah. I was assuming the tables in the database were related (via File, Define, Database).

                              I told you how to select a different target table for import. Can you please answer why you wanted to do that? It's been ~2 years since you posted that question. Have you solved your problem?

                              • 12. Re: I can't select a different target table for import
                                philmodjunk

                                I didn't post the question. I answered it. Then you posted years later with a way to select the file that was, in my opinion, a very foolish way to do that.

                                 

                                I can't read the mind of the OP, but the need to select the correct target table is a common one. Say you have created a new copy of the file and you need to import the data from the original copy into the new one. You may have 1, 2, 10, 300 tables in your solution. It's important to match up the correct target table with the correct source table. But that's just one example. You can use import records to remove duplicates, split data out of repeating fields into separate records, to refactor your data into a new data model, etc.

                                 

                                To repeat the original answer provided years ago:

                                 

                                When doing a manual import (Selecting Import Records from the File Menu), you must select a LAYOUT that is based on an occurrence of the table into which you want to import records. Thus, selecting the layout also selects the target table for you. No need to alter the design of a layout just to select the correct target table.

                                1 of 1 people found this helpful