
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015 12:51 AM
Hello All,
I want to calculate distance on the basis of two postcodes of UK. Is there any API present for it.
Also, how can I call custom APIs in Service Now. In Postcodes.io lot of APIs are present but I don't know how to use them in Service Now. Any ideas?
Regards/Chandresh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2015 02:39 AM
What about the following? You could add the "Location" reference field to tickets and "Current Location" reference field to Users. You would then define Postcodes as Locations, which have longitude and latitude information OOB. If you activate the GeoLocations plugin, it should even populate the long/lat values automatically from the postcodes. If they don't, you should write your own Business Rule script to populate the coordinates.
Once you have the coordinates filled in, you could create a new "Tickets nearby" module for your users, which is a list of records on the Incident table (or whatever table your tickets are in). The module would have a filter that would measure the distance between the Ticket's location and the User's current location. This functionality can be found in GeoLocations as well, as the Script Include called GeolocationUtils, which has the GeolocationUtils prototype with the function "getTwoPointsDistance: function(p1Lat, p1Long, p2Lat, p2Long)".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015 12:57 AM
If you are on Geneva, you could use their new Outbound REST API to connect to external webservices.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015 01:00 AM
Hi Peter, Thank you for your response.I am on Fuji Version and as of now there are no plans to upgrade it to Geneva. What are the options do I have?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015 01:13 AM
You should! Geneva is amazing . Apart from the outbound REST API, there is a plugin called "Geolocation". It offers the following functionality:
The geolocation feature uses Google Maps to track users, plan efficient routes between locations, and assist in finding accurate travel times for applications that require this information, such as Work Management. The system locates users from latitude and longitude information provided by their mobile devices or browsers. Tracking the location of certain users can improve business processes such as the completion of work order tasks. For example, in work management geolocation, the system updates an agent's position each time that agent updates a task record. When the system updates an agent's location frequently, agents and dispatchers can use features like auto-routing to create efficient schedules. Geolocation is available starting with the Eureka release.
It has auto-routing functionality, so it might have functions available to calculate the distance for you. Not sure myself as I haven't used this plugin before.
Out of curiosity, why do you need the distance between postal codes?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2015 01:43 AM
Hi Peter,
Yes, I have tried my hands on Geneva and it looks amazing but since there are some business constraint so can't upgrade it right now.
Also, I went through the Geolocation plugins but it seems it will not fulfill the purpose.anyways thanks for your response.