1 Reply Latest reply on Oct 10, 2014 2:13 PM by mikebeargie

    Location oriented script

    vhaphifarres

      Hello,

       

      "Check in button"- Im going to start off by saying i am very new to scripting and may be biting off more then i can chew but what i am looking to do is have a button activate a script that would find a contact record that is close to the mobile device etc.it would find the devices current location via GPS coordinates and then find the closet contact record in the database that would have GPS coordinates all ready established. after the contact is identified it would create a new record and use the get function to gather information such as weather info. I would also like to see it start a onscreen running clock showing time lapsed.

       

      "check out button"- This would have to find the record that would be established from the check in action. It would generate a time stamp and some calculated fields. after it has done that it would send a pre scripted email referencing the data gathered in that record event and be sent out automatically. maybe test as well

       

      I know there are a couple moving pieces to what im looking to do. Any help on how to build this script out would be great.

       

      sean

       


        • 1. Re: Location oriented script
          mikebeargie

          Your weather info I would just load in a webviewer, would make it much easier than trying to parse it out each time. You can customize a webview link based on the results of a geolocation function.

           

          For your "closest" measurement, that's tough, but is possible.

           

          Step 1) You will need to calculate the coordinates of all of your contacts based on address. You can do this by using a web service and insert from URL.

          http://scarpettagroup.com/location-wheres-my-stuff/

           

          Step 2) You're going to need to create "distance from" calculation that calculates the distance each contact is from a global location

          http://scarpettagroup.com/location-how-far/

           

          Step 3) using the get location functions. Populate the global location. Then it's as simple as finding the lowest number from step 2 in your contacts.

           

          That entire blog series is up your alley.

           

          Your check out action is simple once you do the rest.

           

          It sounds like you've got quite a lot to build and explore, I'd recommend investing a few hours after reading that blog series, trying to come up with what you need, and then boiling it down to specific questions that we can help you with here.