4 Replies Latest reply on May 23, 2017 7:02 AM by schamblee

    Get GPS Location

    eshute

      Hi, newbie here I'm afraid - I'm (trying) designing an app for the ipad and would like to able to set a field so that it automatically fetches and displays the GPS location at the time the record was created. I've found some information on here regarding Location and Location function values and so know its something to do with that but what I cannot find is an idiots guide to how to set up the field and what type of field it should be etc - do i need to write a script and set the field to it?

       

      I tried setting up a new text field (should it be something else?)) and then using the set field option which takes me to the 'specify calculation' screen. I tried entering the following script but it returns a message saying the specified table cant be found?

       

      Jobs::GPS Location = Location ( accuracy {; timeout} )

       

      What am I doing wrong? Is it much more complicated than that?

       

      Can anyone help a clueless person please?? :-)

       

      Thanks!

        • 1. Re: Get GPS Location
          erolst

          eshute wrote:

          I tried entering the following script but it returns a message saying the specified table cant be found?

           

          Jobs::GPS Location = Location ( accuracy {; timeout} )

           

          What am I doing wrong?

          1. The field you're trying to write into Jobs::GPS Location) is already implicit, so you don't have to state that you want to set it (and, in this case, must not, because that expression is not what you wanted).

           

          2. Please read about the syntax of calculations: if you use a function that needs arguments, as almost all of them do, you need to provide values that are used in lieu of these arguments, i.e. a value for accuracy and - optionally, as the curly brackets indicate - a value for the timeout.

           

          See FileMaker Pro 16 Help for an introduction into formulas and functions. Here you can also see what kind of values the Location() function expects, and what datatype it returns, which will determine the datatype of the receiving field.

          1 of 1 people found this helpful
          • 2. Re: Get GPS Location
            eshute

            Thanks but how would I know what those values should be though?

            • 3. Re: Get GPS Location
              erolst

              Use the documentation for the function.

              • 4. Re: Get GPS Location
                schamblee

                You can use an auto enter calculation or a script to enter the location for you.  

                Here is a sample database.  Dropbox - locationSample.fmp12