- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 06:13 AM
Is there a way to get a users location when using the browser based mobile UI?
I put the "current_location" attribute on a field and was able to get the users location when using the actual Android SN Mobile app but this attribute does not affect the field when viewing in the browser mobile UI. Is there any way to get the users location when using the mobile browser?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 08:14 AM
I figured this out for anybody who is interested in the solution. I used HTML5's built in geolocation capability with an onLoad Client Script.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(UserLocation);
} else {
alert('Geolocation is not supported by this browser');
}
// Callback function for asynchronous call to HTML5 geolocation
function UserLocation(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
alert(latitude + ',' + longitude);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2018 08:32 PM
create any string type variable in your form.
In the dictionary of that variable add attribute "Enable current location input helper" true... now when u access from your mobile you will get the current location.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2019 07:11 AM
Hello Ratul,
I clicked on the link, but I can't view the resource that you are linking. It takes me to a developer instance (https://dev44975.service-now.com/navpage.do) and asks me to login.
Is there any chance that you could copy/paste in the information you linked into a reply on this thread?
Thanks in advance!