8 Replies Latest reply on Oct 16, 2015 11:34 AM by rgordon

    Export records: Filepath

    tays01s

      I am working towards an initially standalone solution that will be deployed on Mac, PC, iPhone/iPad. I'm pondering using 'get(desktoppath)'. However, a) does this even work on iOS devices and b) is there a way of having an 'Export folder' to keep any exported files together but still leave options of copying/emailing them elsewhere?

       

      Note: Not done this before so please forgive the naive Qs!

        • 1. Re: Export records: Filepath
          beverly
          • There is a 'get(documentpath)' that works on the iOS (fmgo). This is  a list of FILES that FMGo can see (and the user can see).
          • There is a "get(temporarypath)' that works on the iOS (fmgo). This is NOT visible, is not a storage place that is saved. (thus the TEMPORARY) in the name. )

           

          I suggest you read the FMGo development documentation:

           

          (p. 14)

          Notes

          * By default, the files created by script steps appear in the Device list and are saved in the Documents folder. To save the files in a temporary folder, use the Set Variable script step to create a variable to specify the output file path and filename for the script step.

          You can use the following example to create an email with the file as an attachment.

          Set Variable [$Output; Value: Get( TemporaryPath ) & “sample.pdf”] Save Records as PDF [No dialog; “$Output”; Records being browsed]

          Send Mail [Send via E-mail Client; To: “mailto:linda@glolda.com”; Subject: “Invoice” ; Message: “Test”; “$Output”]

          * By default, when you run script steps, FileMaker Go creates a new output file. If you continue running the script, a number is added to the end of each filename. For example, the first time you run the Save Records as PDF script step for a sample file, the output filename is sample.pdf. The second time you run the script, the filename will be sample 1.pdf.

          To replace the output file with the new one instead of keeping multiple copies, add the file path (file:fileName or filemac:fileName) to the script. For example, if you type file:sample.pdf or filemac:sample.pdf in the Specify Output File dialog box each time you run the script, the sample.pdf file in the Documents folder will be replaced with the new one.

          The following example saves records as a PDF file named sample.pdf and will either create a new file or overwrite the existing file.

          Save Records as PDF [No dialog; “sample.pdf”; Records being browsed]

           

          Get the document here:

          Product Documentation

           

          HTH,

          beverly

           

          p.s. NOTE the 'file:myDoc.pdf" to GET the file that is already stored in iOS Documents. There is no need to add the Get ( DocumentPath ) when reading, only for writing.

          • 2. Re: Export records: Filepath
            tays01s

            Thank you. I take some time reading up.

             

            I assume one of my first 'acts' would be that on first opening my solution it would 'get device' to know what it's dealing with and 'get directory' to set up export and import directories to hold the files?

            • 3. Re: Export records: Filepath
              beverly

              I do this with variables in the script I'm using for the export. Since the filename itself my vary on each export, it's just easy enough to set these up at the time of use. Then no floating variables to worry about.

               

              beverly

              • 4. Re: Export records: Filepath
                tays01s

                My records are 'people' so I'd use their names in the filename created. However, I'd thought to have a set directory to send them to: Files_exported. In reverse I'd have a directory Files_imported.

                • 5. Re: Export records: Filepath
                  tays01s

                  I'm only just familiarising myself with FM Go and just noticed that you can't export .fmp files. So does that mean effectively you can't export a record for use by another FM Go user?

                   

                  Similarly am I incorrect in assuming I'd be able to create a single script to handle mac, pc, ios devices in creating import/export folders for .fmp files transitting from one user to another?

                   

                  Again, apologies for the simplistic Qs; I'm just getting into this subject.

                  • 6. Re: Export records: Filepath
                    beverly

                    There are limited exports available in FMGo, yes. if you need to get a "record" to someone, the .tab (or .txt), .csv or .mer formats might be sufficient.

                     

                    Perhaps this link helps:

                    http://www.filemaker.com/help/14/fmg/en/export_records.html

                     

                    this manual process can be scripted.

                     

                    beverly

                    • 7. Re: Export records: Filepath
                      tays01s

                      Thank you for your help. I'll ponder those links and experiment; appreciated

                      • 8. Re: Export records: Filepath
                        rgordon

                        One of the great mysteries of FM Go is you can't export from FMGO in .fmp12 format and you can only import from .fmp12 format.  I don't think FileMaker wants two iPads/iPhones to share data.  What's a poor developer to do?  As you stated, you can export to .csv.  If you use the Insert from URL step, you can bring the data from the .csv file into a global field. Then you can use some creative scripting to parse the data.  I have one solution where I use this process to scan records to import, field map, update records and add new records all from a .csv file.