Link to home
Start Free TrialLog in
Avatar of Myles Cardiff
Myles CardiffFlag for United States of America

asked on

Export Filemaker Pro Database, All Tables, All Fields

Hello,

I have a Filemaker 12 database (.fmp12 file) and we need a way to export all tables and all fields to CSV, TSV, Excel,  or SQL Server. The trick is we need to be able to do it in a single operation, or as close to that as possible. We understand that container fields won't export, and that's fine.

The only solution we've been told is: "go into each layout in the database and use File - Export". In this case, there are hundreds of tables and layouts, and that process is just not feasible. Plus it takes literally days to perform, and we'll need to do it a few times throughout our project, which is also not ideal.

Is there anyway to just dump the entire thing? Multiple files would be fine.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Will Loving
Will Loving
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Myles Cardiff

ASKER

Hi Will,

Thank you for the detailed response, this looks like what we need. So if i'm understanding this correctly we should end up with a long script with an export statement for each table like this:
Go to Layout [ Employees ]
Show All Records
Set Variable [ $ExportPath ; "C:\my-export-folder\Employees.xlsx" ]
Export Records [ No Dialog ; $ExportPath ; Unicode (UTF-16) ]

Go to Layout [ Customers ]
Show All Records
Set Variable [ $ExportPath ; "C:\my-export-folder\Customers.xlsx" ]
Export Records [ No Dialog ; $ExportPath ; Unicode (UTF-16) ]

...

Open in new window

Is there a way to specify field names in the script, e.g. "CustomerID","FirstName", "LastName"?
You can specify which fields you want to include in the script by using the second part of the Export Records script step which is identical to the "Specify Fields to Export" screen that appears when you manually export records from any layout.

With regard to the Path, you should include "filewin:" as a prefix. If you want to specify the file name exactly you can but you'll simplify your coding by using a calculation that draws the file name from Table (or layout if your layout names are simple).

There are ways to make it even more generic and a loop, but it's a bit more sophisticated and depends on how things are named. This should work fine for what you need. Setup the first few table and then test it to make sure the path is working.
OK , so even with the script, we still need to go into every table manually through the Export Dialog, select the fields, then wait for that table to export?
Never mind, I see what you mean, it asks you when you type that line. Got it.. Thank you!!
This is exactly what we needed. Thanks!
Glad to help