So the situation is this. I have a called shot checkbox. When it is it is checked the value to be reported is @{hitlocationchoice} and when not checked the value reported should be @hitlocationroll I think there are two ways of doing this. One with a radio button that has another one hidden under it or with a sheetworker. Below is my poor attempt at a sheetworker for this issue. // Call Shot vs Random hit location Script
on('change:calledshotcheck' function(e) {
calledshotswitch();
});
// Update Hit Location
function calledshotswitch() {
console.log('*****Called Shot Switch******');
getAttrs(['calledshot_check','hitlocationroll', 'hitlocationchoice'], function(v) {
var attrs = {};
if (v.calledshotcheck === "0") {
hitlocation = "hitlocationroll";
}
else if (v.calledshotcheck === "1") {
hitlocation = "hitlocationchoice";
}
setAttrs({
hitlocation: hitlocation,
});
});
}