« Xojo on Sale | Home | Video playback with m… »

XML Import for FileMaker

Today we introduce our new XML.Import function for FileMaker. it can be used to import any XML file and create records. It translates any field or attribute to fields in new tables. And if the table is missing, the function creates the tables and add fields.

So when you have a job to get regularly a XML imported into your FileMaker solution, e.g. new zip code list every month, you can use this function. First you copy the import script from our example database and import the file once. This will not just import thousands of records, but also create all the required tables. We recommend to put this in a separate import database file, so all those records don't disturb your normal solution. Now when you have maybe 10 new tables generated by our plugin, you can create layouts to show the records. This way you can verify the data is right.

Next step is to use the data. There are two ways. One can be to just reference the import tables from your other database files for lookups, e.g. to find city name for a zip code. Other way is to have scripts walk over the records to copy the relevant portion of the data into your own tables. The imported xml values are all stuffed in text fields and you may have a lot more fields than you may need. So reducing the data and copying it into your own tables will improve performance for lookup. Feel free to add indexes to the tables as needed.

The import process itself runs asynchronously in the background at idle time. So you call XML.Import once and you get back the number of records it plans to create. Now you loop doing script pauses and checking for status. XML.Import.Status will return you the status. It will be "Working" until the work is done and it switches to "Finished". Using the XML.Import.Todo function you can query the current number and show progress dialog like our example.

All tables have three default fields. _RecordUUID is an unique identifier for the record. _ParentRecordUUID provides a link to the record one level higher in the XML. This can be used to find child/parent records. The _CreationTimeStamp is the creation date, so you can distinguish different imports.

Coming soon with next prerelease. For FileMaker 12 and newer.

PS: We also have FM.InsertRecordTSV function to import tab/return text and SQL functions to copy records from within FileMaker or other SQL database to a FileMaker table.
10 09 15 - 11:34
No comments

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.