Use a URL formula button to edit other fields in the same table.

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
Hello!  I don't have a lot of programming experience, but to a certain extent I've managed to use previous answers to find the users current latitude and longitude using a javascript formula in a URL button.  They are stored as variables lat and lon.  Now, I would like to populate the results into latitude and longitude fields within the same table.



Basically, I would like the user to click a button and the record show their latitude and longitude in two separate fields (to be linked to another table for a separate report).



Any help you can provide will be greatly appreciated!
Photo of Caitlyn

Caitlyn

  • 506 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Caitlyn

Caitlyn

  • 506 Points 500 badge 2x thumb
In case you were curious, the code I referenced was from this thread in the later comments:  https://quickbase-community.intuit.com/questions/946376-how-to-dynamically-filter-map-reports-based-on-user-s-current-location
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,572 Points 20k badge 2x thumb
Try something like this:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=547

I am a little confused what your table structure is since you reference both "same table" and "another table." So I simply wrote the code to create a new record to some table identified by the dbid variable. You may have to change the action to API_EditRecord and supply a Record ID# depending on your needs.

In case you are monitoring sketchy users who demand a greater deal of scrutiny I enabled the high accuracy option.

Also note that this geolocation service is opt-in as the user has to agree to give up his coordinates. If you want to silently track your users you will need to use a web service (google for geoip) to determine the latitude, longitude and altitude (they might be in a high-rise building, aircraft or submarine).

If you need assistance implementing this solution fee free to contact me using the information in my profile:

https://quickbase-community.intuit.com/users/513/