Just copy and paste the 'ExportToJson' script into your file and run it. The only other thing you need is the script! You can test it with the unlocked example file. You'll need to install the BaseElements plugin before running the script. So we used the BaseElements BE_WriteToFile function to write each records data directly to the text file. While we wished we could just use one statement to spit out the data, we realized that it could end up being a huge amount of data as there could be millions of records and we'd likely end up with an out of memory issue. My guess is that this isn't the best way to do this, but for our needs, we can substitute the characters back in our Xojo Web App. This means that whoever opens your file on the other side will have to change these values back. In our script, we have several Subsitutions to protect from illegal characters: Once we knew how many records there were, use used ExecuteSQL to build the json data for each record and then saved the data to a text file. For each Table, we got a list of the Field Names. So we created a script to get a list of the Tables. It also allows you to create SELECT statements to get a list of the Tables in the FileMaker file as well as a list of the Field Names for a particular Table. With it you can find data using SELECT statements like: FileMaker has an amazing function called 'ExecuteSQL'. So our goal was to export all the data from our FileMaker Runtime solution. For example, here's some data for contacts which looks wordy, but if you remove all of the returns and spaces quite small: JSON is a very tight format that doesn't use much space to contain the data. The FileMaker Runtime migration scripts won't be needed, which will result way less migration issues since there won't be anything to migrate. When the first update of the Art Licensing Manager 3 comes out it will just copy the existing database file and add any stuff it needs for the new update. This will allow us in the future to just open the prior versions database file without having to go thru a conversion process! It will be a true 'separation model' that many folks strive for when designing FileMaker solutions. ![]() Since we're using Xojo to develop Art Licensing Manager v3 we can use an SQLite database. We don't just want to dump in the data, but massage it as it goes in since the version 3 will have a different design, but the data is very similar. So, when version 3 becomes available we need the ability to import the data from the FileMaker Runtime to the Xojo Web App. For years, each new version of the Art Licensing Manager imported its data from the prior version via a slightly complex migration script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |