1 of 1 people found this helpful
User19752 is correct FMGo limits what you can export and import.
From the Filemaker Go 15 Development Guide :
- importing data from any formats other than .fmp12
- exporting to .fmp12, XML, or Excel .xls format
Only choice is to use another 2nd fmp12 file.
This is unbelievable and FileMaker is calling this a mobile application stack? I think the real answer for mobile application development which not only works, but provides scale would be Couchbase Mobile ( Mobile Database | Couchbase ).
I would have believed that simply providing an export of certain settings data and a simple import of that same data would be a trivial task, but I guess I am wrong on this. Well, sorry to here that. Great post 2Cool and thanks for sharing with the greater community.
It looks like you are trying to manage data during and update to the UI or schema as stand alone on iOS. There are ways of doing this, but this one obviously does not work.
1 of 1 people found this helpful
Although FMGO can't import the CSV file, FileMaker does give you the tools to accomplish what you want. Use Insert URL to insert the csv file into a global container field. Then use Set Variable to store the data from the csv into a variable. Each record becomes a value so now you can loop through the values in the variable to create your records.
Another option is to create an export file that contains the fields that you want to export. Store this file in a global container field. When you want to export records, use an Export Field Contents to export the export file. Then write the records or import the records into the export file.
Both of these require a little trial and error to get the scripts to do what you want.
Thanks All for the prompt responses. This message board is really top notch. rgordon, thanks for the info. I will give this a try and let the board know how it comes out.
For the filemaker product, team, is there some reason that file export and import was not implemented in a more straightforward way using the steps I was attempting in my export and import script? This already works perfectly on my Mac and it would have saved me much angst had the same logical steps worked for iOS devices. Even on iOS devices the export to cvs, mer, works just fine, but not the import. This seems really inconsistent, to be able to export and import on a Mac, yet the same functions only allow export on an iOS device.
Update: One step closer but . I am now able to export a mer file and then import it back into a container field using the Insert from URL using the "file:" URL specifier.
Set Variable [ $FilePath; Value:"file:/" & Get(DocumentsPath) & "fileb4.mer" ]
Insert from URL [ MyList::ImportFile; $FilePath ] [ Select; No dialog ]
As a test, I can export the merge file from the container back to a file and it looks fine.
Now, how do I access the file text in the container so that I can parse it to recreate my table?
I have tried
set variable("buffer", value: MyList:myContainer)
but buffer is only assigned the name of the file in the container.
I need to be able to parse the mer file text so that I can recreate records for my table or merge new records into my table.
Also, does anyone have a function that can parse the merge file contents? This seems like one of those cases where someone would have posted a simple script to parse through the contents rather than a million people re-writing the same parsing script. Thanks in advance.
Base64Decode ( Base64Encode ( Container ) )
Glad to see you are working this out. It is not too hard. There is a
thread on methods for retaining data during FIAS updates. Sharing data
is different though.
I do not know of a standard script for parsing a csv, but it is a simple process I think.
2cool, I gave you a bit of misinformation. You want to use Insert from URL to put the file into a global text field, not a container field. Sorry for the error. This will put the data from the file into the text field. Then you can parse the data.
There is not a simple script to parse the data because once you parse the data, you need to know where to put the data
Thanks all and rgordon. This is more like it. I now have the file in a global text variable and see the entire file as a large text buffer. Now it is just a matter of parsing the file and moving the data from the parse into fields. I will work on a simple script that will do a getNextItem to walk through the buffer and pull out each item.
If the original file is is a single table it is pretty easy to parse. If it is relational with multiple tables you can format your export to make it is a few more steps but still pretty easily done. If it its a known structure you create you likely do not need the header row of a merge file. If it were me I would parse it into one table and then you have access to all the FM tools to move data around and make relationships as needed.