Skip to main content
Nintex Community Menu Bar
Question

Accessing API key from custom label and also adding script tags in skuid javascript snippet

  • July 11, 2024
  • 3 replies
  • 23 views

Forum|alt.badge.img+4

We are doing geo coding on our records by calling google api from skuid javascript snippet, we want to include api key as well in the request.

function load_map_from_address(mapid, address) { // check if gps has been locally cached. geocoder = new google.maps.Geocoder(); //alert(geocoder); var geocoderAPIKey = 'geocoderAPIKey '; geocoder.geocode({ 'address': address }, function (results, status) { //alert(status); if (status == "OK") { var gps = results[0].geometry.location; create_map(gps.lat(), gps.lng(), mapid); } else { $('#' + mapid).html('

address not found

').show(); } }); ``` } Am looking for a way to add below script tag in the javascript snippet where we are calling geocode method and also want to access api key using custom label..

3 replies

Forum|alt.badge.img+10

Praveen,

In your Skuid Page Builder, add a JavaScript Resource of type ‘External’.  You can then add the URL for the Google API.

Thanks,

Bill


Forum|alt.badge.img+4

Thanks Bill. I have api key in custom setting, is there any way to point it there.


Forum|alt.badge.img+10

Praveen,

You can create a model to load your custom setting.  I am not sure if the model will load before Skuid attempts pull in the external resource.

Thanks,

Bill