I'm creating a new character sheet, but I'm having difficulty creating a universal updater for stats. The issue I'm running into involves the asynchronous nature of the getAttrs() function, I think. The HTML code I am using for the test is below and displays as expected: <input type = "input" name = "agility"/> <select name = "attr_upd_atr"> <option value = "agility">Agility</option> <option value = "body">Body</option> <option value = "charisma">Charisma</option> <option value = "edge">Edge</option> <option value = "essence">Essence</option> <option value = "intuition">Intuition</option> <option value = "logic">Logic</option> <option value = "magic">Magic</option> <option value = "pain_res">Pain Resistance</option> <option value = "reaction">Reaction</option> <option value = "strength">Strength</option> <option value = "willpower">Willpower</option> </select> <br> <input type = "number" name = attr_upd_atr_val"/> On a change to the upd_atr_val, the sheet worker triggers, but as it runs through the code, the getAttrs call doesn't get processed until after the following loop to set the correct attribute (this loop currently is not finished, so does not actually do anything other than play stubs to track the progress of the program.) Sheetworker Javascript is here: <script type="text/worker"> const stats = ["agility", "body", "charisma", "edge", "essence", "intuition", "logic", "magic", "pain_res", "reaction", "strength", "willpower"]; on("change:upd_atr_val", function(input_info) { let atr_value = parseInt(input_info.newValue)||0; let atr_change = "test"; let atr_req = ["upd_atr", atr_change]; console.log(atr_value); getAttrs(["upd_atr"], function(values) { //following lines execute and display properly, but only after the next function call (the setAttrs call) runs console.log("update1 " + values.upd_atr); console.log("update3 " + atr_change); return values.upd_atr||""; console.log("update3 " + atr_change); }); //following line executes before preceding console.log messages console.log("update2 " + atr_change); stats.forEach(function (stat) { // this line also executes befor3e the getAttrs call complete // console.log([stat]); if (atr_change == [stat]) { getAttrs([stat], function(val2) { let val = (parseInt(val2[stat]))||0; // console.log(val); if (val != 0) { // console.log("operation"); } }); } }); }); </script>