11 Replies Latest reply on Mar 11, 2015 7:47 PM by TomPingel

    exporting data from client (Ipad) to host

    TomPingel

      Title

      exporting data from client (Ipad) to host

      Post

      I need to 'download' data from the client database to the host in a shared database application.
      Does the 'host' see a 'client' so that the the host could import the data?

      Or how would I 'push' the data to the host from the client?

      The client will initiate the download.

      FMP 13, FM Go 13.

        • 1. Re: exporting data from client (Ipad) to host
          TSGal

          Tom Pingel:

          Thank you for your post.

          The client database on the iOS device would call an import script on the host machine.  In essence, the script would import the data from the client database file.  For more information, see pages 8-9 of the FileMaker Go Development Guide:

          https://fmhelp.filemaker.com/docs/13/en/fmgo13_development.pdf

          TSGal
          FileMaker, Inc.

          • 2. Re: exporting data from client (Ipad) to host
            AppGuy

            Tom-

            You could also look into syncing as well.. basically.. pushing or pulling a data set.

            JP

            • 3. Re: exporting data from client (Ipad) to host
              TomPingel

              Syncing isn't what I need. There is significant difference in functionality of the data sets and only a portion of the data is 'pulled' up to the client for processing.

              I had considered the importing, A couple of questions:

              The host needs the ip address of the client in order to do a remote import. Since my application is/will be deployed to multiple businesses, I can't 'fix' the ip address in the 'file path list' for the import in my solution. It will vary by business.  Also, the call to the import script in the host will be initiated in the client.

              I see there is a 'get(hostipaddress)' function. What I need is a 'get(clientipaddress)' function or 'get(myipaddress)' or equivalent. I don't see such a function listed.  Is there a way that I can get the ip address of the client so it can be passed as a script parameter to the call of the import script in the host?

              • 4. Re: exporting data from client (Ipad) to host
                TSGal

                Tom Pingel:

                There is no need to select the IP Address of the client.  Just use the filename directly.  Since the file is already open on the client, the host will use the file and import from it.

                TSGal
                FileMaker, Inc.

                • 5. Re: exporting data from client (Ipad) to host
                  TomPingel

                  When I initiate the importing script from the host, that is true and the import works (with or without the ip address in the file path).

                  When I initiate the importing script from the client, the import script step gets a 'file not found' error whether or not the ip address is in the file path specification.

                   

                  Does this mean that  a client cannot initiate a script in the host that will import data from the client to the host? Might that be because the script the client executes is from the host file, but not the instance of the file running on the host computer?

                   

                  • 6. Re: exporting data from client (Ipad) to host
                    TSGal

                    Tom Pingel:

                    If you can access the hosted file from the iPad, then your Wi-Fi/3g network is working.  Your script should then call the import script on the hosted file.  There is no need to specify the IP Address of the iPad.  Assuming the name of the database on the iPad is "iPad.fmp12", the Import Records script step should specify:

                    file:iPad.fmp12

                    The hosted file will then import the records from the open iPad.fmp12 file.

                    TSGal
                    FileMaker, Inc.

                    • 7. Re: exporting data from client (Ipad) to host
                      TomPingel

                      I can access the hosted file from the client (other scripts in the host without 'import' script steps work just fine when called from the client). Network is working fine.

                      This is the import script called from the client. The 'import' step gets a 'file not found' error.

                      Since other scripts without an import step work when called from the client, but this one doesn't, I must be missing something.

                       

                      • 8. Re: exporting data from client (Ipad) to host
                        TSGal

                        Tom Pingel:

                        Following the steps in Example 2 on page 9 of the FileMaker Go Development Guide, do the following:

                        1. In your hosted file, change your "downImportScheduledWOsChargesFromClient" script step to as follows:

                           Go to Layout [ "WOs" (WOs) ]
                           Set Variable [ $FilePath ; Value: Get (DocumentsPath) & "WorkSchedulerClient.fmp12" ]
                           Import Records [ No dialog ; "$FilePath" ; Add ; Mac Roman ]

                        2. In the Import Records script step, select Specify import order.  If the source fields do not appear in the Import Field Mapping dialog box, then select Specify data source and add another path to WorkSchedulerClient.fmp12.  If necessary, open with FileMaker Pro the WorkSchedulerClient.fmp12 file, select the field mapping order.  Once set, save the import order and close the file.

                        3. In FileMaker Go, open the local WorkSchedulerClient file as well as the hosted FileMaker Pro file.  Run the script "downImportScheduledWOsChargesFromClient".

                        Let me know if you continue to have difficulty.

                        TSGal
                        FileMaker, Inc.

                        • 9. Re: exporting data from client (Ipad) to host
                          TomPingel

                          Wish I had better news. See attached

                          • 10. Re: exporting data from client (Ipad) to host
                            TSGal

                            Tom Pingel:

                            Since you are running Script Debugger, you are using FileMaker Pro.  If you are trying to execute this from FileMaker Pro, then make sure you include the path to the file on your computer second to get the import to work.  Once done, then launch FileMaker Go and execute the hosted script from FileMaker Go.

                            TSGal
                            FileMaker, Inc.

                             

                            • 11. Re: exporting data from client (Ipad) to host
                              TomPingel

                              I've been told by others that this wouldn't work. I'm starting to believe them.

                              Necessity is the mother of invention and I had an epiphany on a walk around our frozen lake this afternoon. Here's how it works:

                              From the client, perform a script in the host to set a 'download requested' flag (this always worked).

                              In the host, 'install timer on script' to run a script regularly looking for the 'download requested' flag. When detected, initiate the import from within the host (when initiated within the host, the import always worked). Reset the flag to wait for the next request.

                              The only question is the interval to use to run the 'flag check'. Since the client will need to be connected to the network for the import to work, and the field techs are going to want to be done with downloading their data as quickly as possible at the end of the day, the timer will be checking several to many times a minute so it looks like one continuous process from starting the download from the client to completing the download within the host.

                              I just tested this - and it worked.