9 Replies Latest reply on Dec 8, 2016 11:25 AM by philmodjunk

    Can I duplicate a table's structure?


      I have a table with many fields. I need to create a second table that has the same fields, types, etc as the existing table. Is there a fast, easy way to do this without manually entering every field name and type into the new table? (i.e. a way to copy and paste a table's structure)


      The table is old and has ~175 fields in it, so I would really prefer not to have to do this manually.



        • 1. Re: Can I duplicate a table's structure?

          In FileMaker Advanced you can copy and paste tables inside Manage | Database. You can also copy and paste field definitions to move just a selected group of field definitions from one table to another in a single copy/paste operation.


          In FileMaker Pro and Advanced, you can use Import insert Records with "new table" specified as the target table for your import and it will create a new table. This does import data, but if you set up the source table with a found set of a single record, you need only delete a single record after importing to get an empty table that replicates the field definitions of the other.


          In using any of these methods, be careful of calculations that refer to fields in a related table occurrence. Since the new table does not replicate relationships to other tables, these references will fail and FIleMaker automatically encapsulates the calculations in /* comment brackets like these */ so that you can add relationships before editing the calculation to remove the comments and get them working.

          • 2. Re: Can I duplicate a table's structure?

            I don't have Advanced, so I assumed there would be an easy solution there. But your second paragraph worked like a charm in Pro. Thanks so much!

            • 3. Re: Can I duplicate a table's structure?

              Why do think you need to do this?

              Usually this is not necessary and it often indicates a design problem or lack of awareness of effective relational data structure.

              • 4. Re: Can I duplicate a table's structure?

                You're absolutely right -- it's poorly designed. I have been tasked with addressing some compliance issues with a client's old Filemaker application (the first step was bringing them up to fmp12 from fmp7) by the end of the year, and then refactor and add functionality once it gets the OK from our compliance department. I'm doing this as part of a band-aid solution to a home-brewed auditing trail I'm going to try to implement until I can refactor the entire solution. They're well aware that this is going to require more effort in the long run but the compliance issues came in as a top priority so I'm forced to work with what I have for now.

                • 5. Re: Can I duplicate a table's structure?

                  I strongly suggest that you get them to pay for a copy of FileMaker Advanced and at least one major developer support tool such as Base Elements or Inspector Pro. The time saved and options for better design will more than pay for the added cost.

                  • 6. Re: Can I duplicate a table's structure?

                    Do you have any resources comparing the two, which tool is better for certain types of development, or any thoughts about which tool you prefer? I'll bring it up to them today.

                    • 7. Re: Can I duplicate a table's structure?

                      FileMaker Advanced can do everything that FIleMaker PRo can do, but then comes with a suite of additional tools that allows a developer to do many additional tasks. Any file created/modiifed by FileMaker Advanced can still be opened and used in FileMaker Pro. You need just one copy of Advanced for each developer to use. FileMaker Pro is for the users who will use your solution.


                      Features Found only via Advanced:


                      Database Design Report--a report on how your file is designed that is useful as is, but is extremely useful when imported into a tool such as Base Elements or Inspector Pro where you then have a searchable database showing you many things about your file--including easy ways to find things that are not set up correctly.


                      Custom Menus--the ability to change what is available to the users in the menus--including the ability to replace a standard menu option with one that runs a script that you designed.


                      Custom Functions--There are huge libraries of custom functions available on line that do special and complicated calculations for you. With Advanced, you can import these into your solution as well as create your own.


                      Script Debugger--This one can both save you hours of time figuring out why a script doesn't work as expected and can also teach you more about how scripts and script triggers work. You can step through a script one step at a time and watch it execute--seeing layouts and data change. You can use the data viewer at the same time to check on the values of fields and variables and to test calculation results performed by the script.


                      Data Viewer--Not only lets you monitor the value of fields and variables while using the script debugger, but can be used as a "test bed" for creating complex calculations and testing to see how they evaluate.


                      You can also create run time solutions (that do not need FileMaker Pro, but have distinct limitations in what they can do) and encrypt files with Encryption at Rest.

                      • 8. Re: Can I duplicate a table's structure?

                        Thanks for all the useful info! Do you use Inspector or Base Elements (or both)? Which do you prefer? I'll probably end up trying them both out if I can but wouldn't help to get some extra input.

                        • 9. Re: Can I duplicate a table's structure?

                          I'm most familiar with Base Elements as this is what my employer provides. But I've seen several demos of Inspector and those frankly "blow my socks off". And others have recommended a few other choices. I suggest visiting the web sites of each and especially look for any that might provide any sort of demo copy. Once you have advanced, you could then research them further to see what might be a better "fit" for you and your projects.