One of the most significant enhancements in the FileMaker 18 Platform is the array of new script steps related to external data files. These include ‘Create Data File’, ‘Open Data File’, ‘Write to Data File’, ‘Read from Data File’ and ‘Close Data File’. This ability to read and write to external data files is great new addition to an already strong FileMaker platform, and one for which we envisage a number of useful applications: in FileMaker 17 and earlier has always been possible to export database data to files in tab separated values, comma separated values, DBF, Merge, HTML table, XML and Excel formats. ‘Live’ database data can be queried via Open Database Connectivity (ODBC) and Java Database Connectivity (JDBC) and also https/JSON with the new FileMaker Data API.
So how is this different from the existing features and why is it needed?
Firstly, all of the above methods, only allow for the export and transfer of data which is already within a database table structure. If you wanted to capture debugging information or create a new export then the first step would be to have to create the database structure necessary to store the information and then script to export it. If the information is transient then you may also then need to write maintenance routines to ‘prune’t or delete this information. With the new script steps, data can be captured directly to a variable and this variable is then written to the external data file - no new structure needed, making the code potentially simpler and more portable. This is really helpful when for example, you are writing debugging routines or persistent error logs to be saved on your server at timed intervals..
Secondly, there are many cases where you might want to transform data structure and then export it into another format. I can think on many occasions where I wanted create a simple XML export without having to write XSLT to achieve this quickly. Similarly, it could be used for local dumps of data to JSON or SQL formats for example.
This feature is not without its limitations. FileMaker is limited to writing 64MB of data at a time with the Write to File script step and so for large scale exports it will be necessary to parcel out the writes into 64MB chunks.