3 Replies Latest reply on Jun 10, 2017 12:29 AM by siplus

    Putting the output of 'Export Records' into a container field


      I am trying to make it easier to import and export my tables as I create newer versions of my Filemaker solution.  Here is what I have for my export:


      Go to Layout ["Service Record" (SRV)]

      Show All Records

      Export Records [With dialog:off "Service_Records.fmp12"; Unicode (UTF-16)]

      Go to Layout [original layout]

      Exit Script [Text Result:Get ( LastError)]


      This ends up saving the 'Service_Records.fmp12' file in my documents folder.  How can I store this in a container field with global storage?  Basically when I'm done running the export, I'll have a temporary container I can grab the file from.


      Going the other way, for import, I'l like to be able to open my solution of my Filemaker server and drag the 'Service_Records.fmp12' to a container then hit import.  My script will then automatically delete all records from the table, import the data without performing any autocomplete actions and then use 'Set Next Serial Value' to automatically set the serial number.  I've noticed Filemaker takes a long time to do the imports on my Filemaker server compared to when I do the import locally.  I'd like to be able to upload the imported data into my solution on the Filemaker server, then hit import to do it more quickly.


      Is this even possible?



        • 1. Re: Putting the output of 'Export Records' into a container field
          Johan Hedman

          You can from the server export data to the Documents folder at FileMaker Server. Then since you know the name of the file you can use new file reference using Variables (example $FileName) to import records using FileMaker Server.


          FileMaker Server as working so much faster then FileMaker Pro importing and exporting data.

          1 of 1 people found this helpful
          • 2. Re: Putting the output of 'Export Records' into a container field

            For one thing, you'll want to learn how to set and use a $path variable. This is a normal FileMaker variable with the file path to the file you are about to create by exporting and which you can then use again to insert that file into a container field.


            You can use an expression such as:


            Set Variable [ $Path ; Value: Get ( DesktopPath ) & "yourFilenamewithextensionhere" ]


            You can use this $path variable by name as the name of the file to export and the name of a file to insert.


            But you'll also need to read up on the limitations of Import Records when used server side. Unless they've changed this with the most recent release, there are sever limits on file types and locations. You can search out a knowledge base article that provides the details. As I recall you can't export/import a FileMaker file, you have to use other file types.

            1 of 1 people found this helpful
            • 3. Re: Putting the output of 'Export Records' into a container field

              Set Variable [ $Path; Get(DocumentsPath) & Service_Records.fmp12]

              Insert File [ YourTable::YourContainerGlobal ; “$Path” ]

              Commit Records/Requests [ With dialog: Off ]