Tracking User GPS

Hey folks,

My goal is to allow a user to login to the App from wherever they’re located, make updates as necessary, and track their GPS location as they move while a task is in a specific status.

The intention is to allow another user, like a manager, to be able to view the user on a map.

I’ve read that GPS tracking is possible but can’t seem to find documentation on the usage.

Am I dreaming here?

Edit: this reply was entirely incorrect. Sorry!

Thanks!

If there was a way to record locations for a user and display it on a map, it then opens up the world where a user (could be a customer, could be an office manager) can monitor arrival of someone similar to a ride-share experience.

At first I thought it would be natively available but I’m also quite new here. :stuck_out_tongue:

On top of that, calculating an arrival time estimate based on the user’s location and the location to which they are traveling would fill the other gap.

That’s possible with pipes. Either with the Google Directions API or a other service.

Good to know. I assumed so, but, as I stated, I’m new! I’ve explored more than a dozen platforms (along the lines of Tadabase) and I’m blown away with what’s possible with this platform.

With Pipes, would I be able to include a time estimate in a notification? For instance, since I can use variables, could an Email include an estimated arrival time based on the user’s current location and end location?

  1. User is at X
  2. User traveling to Y
  3. Time to travel from X to Y is ## mins
  4. Include ## mins or arrival time in the Email message when sent.

In order to use the pipe values, you’ll need to save them to a record. Let’s say you had event records with drivers assigned to the event, it could look something like this:

  1. You assign a driver to a event record
  2. A pipe runs either from the submit form above, or you could run it in an action link
  3. Pipe calculates multiple values between either a User’s record address, or a generic origin address and the address of the event record
  4. Returned pipe values such as, drive time, distance, arrival time, departure time, and directions are saved to the event record
  5. Small note on arrival/departure times. I think you can calculate either by supplying the opposite but I can’t remember.
  6. An email system/form is setup to email record information to the assigned driver, or whoever else

Sounds straight forward.

The time of the ‘action’ matters. For instance if it’s a delivery driver who presses a “In Transit”, that would:

  1. Get current location of the Driver
  2. Take that location (lat/long) and record to a ‘Location’ table (I think?)
  3. Calculate time & distance
  4. Record the calculation, capture in some table, like Events
  5. Return the variables to use within the Email

Some items that come to mind:

  • I don’t think that Email can be sent immediately because it will need to ensure the variables have been calculated first
  • If for some reason a calculation fails, include some form of an ‘if’ statement to use generic phrase such as “The Driver will be there shortly” versus “The Driver will be there in 20 minutes”

Am I overthinking or would you say it’s reasonable?

If the users address will be changing, like a delivery driver, you’ll need a form or action link to set the users current location to a user record field like {last known location}.

In order to use the directions API, you have to send an origin and a destination address from either a stored record value or a form value.

1 Like

Looks like I’ll need to grab a Pro plan in order to try Pipes. I’ll take your word that they’re the missing link for most of what I’m after here!

So far I’ve figured out how to use the “Travel Distance” Pipe successfully retrieving results via Google’s Distance API.

Just wanted to add, since I didn’t see it asked, but in record rules you can save the Users Current Location to any address field.

1 Like

@fly sorry I got this way wrong! So saving a users location is much easier than I said. Getting the directions still requires the pipe

Sounds like that’s what I’m after. I can store a current lat/long for a given user based on their native GPS? If true, do I create a Lat Text field and Long Text field in the table?

Really running a blank on how to get the current User’s location via an Action Link. Seems to be the only missing piece at this point.

You probably need to do it from a form’s record rules

My intention is the following:

  1. User access the app from their Mobile device
  2. User views a record for details
  3. User makes an update (like changing the status) to the record via an action link
  4. User’s current location is immediately checked (only at this point do we want to get their current location)
  5. Pipe runs taking their current location and destination to get travel time & distance

#4 is the unknown. I found mention of GPS a couple times, and this page doesn’t really help much on how GPS can be used - https://docs.tadabase.io/categories/updates/article/get-user-current-location#bkmrk-page-title

What datatable are you storing the user gps data in?

None, because I don’t know how to even get the user GPS from the user.

It probably makes sense to store the location in the User table as something like “Last Location”.

That’s what I would suggest. So in the users table, make an address field called {last location}.

If your details page is for a record that’s connected to users, you can use an action link to the following:

  1. Update connected user record
  2. Set {last location} to users current location

I think that should work. I’ve never built something like this before so I’m going off memory of component/feature options.

I might have some time tonight or tomorrow to build an example