Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Embed Map Pages to Case Task Form

Amit83
Tera Contributor

Hi Team,

 

I have created a map page to track Assigned To's location. How can I attach it to sn_customerservice_task form?

 

Regards,

Amit

1 ACCEPTED SOLUTION

Amit Pandey
Kilo Sage

Hi @Amit83 

 

As a workaround, would recommend you to create a UI Action with following script-

 

     var latSource = g_form.getValue('u_fe_last_latitude');
     var longSource = g_form.getValue('u_fe_last_longitude');

    var latDest = g_form.getValue('latitude');
    var longDest = g_form.getValue('longitude');

    var mapsUrl = 'https://www.google.com/maps/dir/?api=1&origin=' + latSource + ',' + longSource + '&destination=' + latDest + ',' + longDest + '&travelmode=driving';

    g_navigation.openPopup(mapsUrl);

This will open the Google Maps in a new window showing the route, eta and source and destination.

 

Please mark my answer helpful and correct.

 

Regards,

Amit

View solution in original post

5 REPLIES 5

Amit Pandey
Kilo Sage

Hi @Amit83 

 

As a workaround, would recommend you to create a UI Action with following script-

 

     var latSource = g_form.getValue('u_fe_last_latitude');
     var longSource = g_form.getValue('u_fe_last_longitude');

    var latDest = g_form.getValue('latitude');
    var longDest = g_form.getValue('longitude');

    var mapsUrl = 'https://www.google.com/maps/dir/?api=1&origin=' + latSource + ',' + longSource + '&destination=' + latDest + ',' + longDest + '&travelmode=driving';

    g_navigation.openPopup(mapsUrl);

This will open the Google Maps in a new window showing the route, eta and source and destination.

 

Please mark my answer helpful and correct.

 

Regards,

Amit