How to save a JS Var to a field

One common pattern in Skuid Pages is to have a Ui-Only Model called “Vars” or “PageVars”, which has a single row in it (which gets created on page load using “Create default row if model has none”. Then you can save data to various fields in that Model from your code, e.g. like this:

navigator&#46;geolocation&#46;getCurrentPosition(function(position) {  <br /> var PageVars = skuid&#46;$M("PageVars");<br />  PageVars&#46;updateRow(PageVars&#46;getFirstRow(), { "Latitude": position&#46;coords&#46;latitude,``` "Longitude": position&#46;coords&#46;longitude });

continueSomeProcess();

});<br /><br />Then, anywhere in Skuid, you can grab the value of the Latitude / Longitude in the Action Framework, or using Merge Syntax, or you can display the Latitude / Longitude in a Field Editor --- whatever you want.