1 2 Previous Next 21 Replies Latest reply on Jun 29, 2017 10:21 AM by acohensitt

    FileMaker Go cannot import the cvs that it just exported

    2cool

      I am having problem doing what seems to be very simple. Using only a Go app, I simply want to write out all of the records from a table to a file and then read the records back into the same table.

       

      Here is what I need to do:

      1) I have a standalone iOS FM app.

      2) I need to save table data from my iOS app as a CSV so that I can read the same CSV back in later.

      3) I may also want to e-mail or text the CSV to other users so that they can merge the data into their devices.

      4) The app must be standalone and not require any interaction with a FM server to FM Pro.

      5) The Go App must create the file and the Go app must be able to read the file back in.

       

      I am getting an error 3 on the import. When I include the iOS filter in FM, it inserts (NOT COMPATIBLE) in the import records function. The manual indicates that it is compatible. I have tried mer, cvs, tab delimited text, etc. All export but all fail on import. Also, the export writes my data out correctly. Why can I not export a file and then re-import the same file? Any suggestions?

       

      Here are the simple scripts:

      Export Attached:

      Import Attached:

        • 1. Re: FileMaker Go cannot import the cvs that it just exported
          user19752

          It is unbelievable but normal behavior, since help saying

          FileMaker Go only supports importing from one FileMaker Pro file to another FileMaker Pro file.

          In FileMaker Go, exporting to .fmp12 and XML formats is not supported

           

          You need pre-built table for that purpose.

          1 of 1 people found this helpful
          • 2. Re: FileMaker Go cannot import the cvs that it just exported
            schamblee

            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

             

            FileMaker Go 15 Development Guide

             

            Only choice is to use another 2nd fmp12 file.

            1 of 1 people found this helpful
            • 3. Re: FileMaker Go cannot import the cvs that it just exported
              regex

              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.  

              • 4. Re: FileMaker Go cannot import the cvs that it just exported
                bigtom

                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.

                • 5. Re: FileMaker Go cannot import the cvs that it just exported
                  rgordon

                  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.

                  1 of 1 people found this helpful
                  • 6. Re: FileMaker Go cannot import the cvs that it just exported
                    2cool

                    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.

                    • 7. Re: FileMaker Go cannot import the cvs that it just exported
                      2cool

                      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.

                       

                      Any suggestions?

                       

                      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.

                      • 8. Re: FileMaker Go cannot import the cvs that it just exported
                        bigtom

                        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.

                        • 9. Re: FileMaker Go cannot import the cvs that it just exported
                          bigtom

                          I do not know of a standard script for parsing a csv, but it is a simple process I think.

                          • 10. Re: FileMaker Go cannot import the cvs that it just exported
                            rgordon

                            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.

                            • 11. Re: FileMaker Go cannot import the cvs that it just exported
                              rgordon

                              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 

                              • 12. Re: FileMaker Go cannot import the cvs that it just exported
                                2cool

                                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.

                                 

                                Thanks Again!

                                • 13. Re: FileMaker Go cannot import the cvs that it just exported
                                  bigtom

                                  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.

                                  • 14. Re: FileMaker Go cannot import the cvs that it just exported
                                    rgordon

                                    This script will parse the data from any .mer file that has been Inserted into a global text field as long as the data is from the same table and the field names match from the first line of the merge file with the field names in the table.

                                    script.png

                                    1 2 Previous Next