Page: module.js
(function(){ var dbid = "application dbid"; var dbidTable = "table dbid"; var apptoken = "app token"; $.ajaxSetup({data: {apptoken: apptoken}}); $("a.QBU_Button").on("click", function(event) { console.log("onclick in module.js"); var satellite = this.dataset.satellite; console.log("Satellite#:", satellite); var url = "https://api.wheretheiss.at/v1/satellites/"; var options = { id: satellite, format: "JSON" } $.get(url, options).then(function(resp) { console.log("Latitude:", resp.latitude); console.log("Longitude:", resp.longitude); console.log(JSON.stringify(resp, null, " ")); }); }); })();
Button: (rich text formula)
[iol] & "module.js" & [/iol]
&
"<a class='QBU_Button Vibrant Success' " &
" data-satellite='" & [satellite] & "'" &
">Button</a>"
What I can't figure out is how to take the resp.latitude value and use the API_EditRecord to insert the latitude value into the current record into Field 7 Latitude (text field).
------------------------------
Randy
------------------------------