How to get current location of a user to input into google maps directions API.

PranavSuj96
Mega Expert

Hello, 

 

I have created a scoped roadside assistance application and created a service portal alongside it and have a page with google maps directions API. All I need is to get the users current gps coordinates and constantly have it for about an hour. Same with the tow truck driver. How would I go about this??

 

 

1 ACCEPTED SOLUTION

current_location doesn't appear to be an available reference for sys_schema_attribute_m2m
but you should be able to add the value
current_location=true
directly into the attributes field on the dictionary form view for your string field.

 

View solution in original post

5 REPLIES 5

Tony Chatfield1
Kilo Patron

I think you would need an app on the users mobile that pushed the gps coordinates back to your servicenow instance.

The ServiceNow app has this covered

https://docs.servicenow.com/bundle/london-platform-user-interface/page/administer/tablet-mobile-ui/c...

but I assume\suspect you would want a custom phone app for your roadside customers.

Cool this helps a bunch! Thanks. I needed help with one more thing.

The docs say the following:

Take advantage of mobile device tracking features such as GPS location by configuring a string field to use the current_location dictionary attribute.

 

I went into my Roadside Assistance Request form and added a string field but not sure how to attach this dictionary attribute. Do you know how?

current_location doesn't appear to be an available reference for sys_schema_attribute_m2m
but you should be able to add the value
current_location=true
directly into the attributes field on the dictionary form view for your string field.

 

Thanks!!!