2 Replies Latest reply on Sep 1, 2016 11:36 PM by Johan Hedman

    Import script from folder FM15

    stu@party4less.com.au

      Hi all, i am trying to make a script but having no look and hopefully someone can assist with this.

       

      Basically i want fm to watch a folder on a server to import a CSV file created by my web designer from the website payment system.

       

      The website will produce a csv file and fm to check every few mins for a file, if file in the folder then import details and create an order number and auto send an email with the booking details as pdf.

       

       

      The table im importing to is called Booking and the fields the order will create is

       

      ClientNAme

      ClientEmail  < Send details to this email of ordernumber etc (i will create an invoice layout and perhaps save that as pdf and send that)

      PickupName

      PickupAddress

      PickupPHone

      PickupEmail

      DeliveryName

      DeliveryAddress

      DeliveryPhone

      DeliveryEmail

       

      When importing it needs to create a new record under

      _pk_booking_id

       

      I will be running FM from the Server on my personal Windows Server and have the folder it to watch in

      c:/FMimport/order.txt

                          order2.txt

       

      I want filemaker to delete the file after import and i will get the web designer to have the export order to look for file order.txt and if exists name order2.txt etc.

       

      Hope this makes sense and someone can help because this is beyond my expertness

       

      Please no negative posts, im not asking for abuse but assistance.

       

      Thanks

      Stu

        • 1. Re: Import script from folder FM15
          philmodjunk

          Abuse is really rare in this forum in my personal experience.

           

          Unless this folder is located inside the server's documents folder, you'll need to use either a plug in or a system script/batch file to read the files listed in the folder to tell whether or not a new file has been added.

           

          If you locate it inside the documents folder, the Get ( DocumentsPathListing ) can list the contents of your folder and you can check it for new additions. Otherwise you'll need to either generate a directory listing of the file folder and import it as text or use one of a number of different plug ins that offer the ability to do this.

           

          Once you can get the name of the newly added file, the Import Records script step can be used to import your data.

          1 of 1 people found this helpful
          • 2. Re: Import script from folder FM15
            Johan Hedman

            Install the plugin Base Elements (free) BaseElements Plugin | Goya Pty Ltd

             

            Then you can use the plugin to move/delete/create folders.