It is more than likely that I am trying to do too much again - but I feel like I am close. I just can't get the first sheetworker to trigger the second one without causing other issues (eg, if I take out the return statement, the spell equips, but the checkboxes are all blank and there's other unwanted behaviours caused by the sheetworker affecting itself). With the current code below, when either of the spells are activated they successfully populate a row on the repeating section, they even check the 'equipped' box - but it doesn't actually equip it, and it doesn't uncheck the current weapon either. on('change:steel_claw change:vorpal_blade', function() { getAttrs(['steel_claw', 'vorpal_blade'], function(values) { const steelClawActive = values.steel_claw === "1"; const vorpalBladeActive = values.vorpal_blade === "1"; if (steelClawActive || vorpalBladeActive) { getSectionIDs('repeating_meleeweapons', function(ids) { const attrsToGet = ids.map(id => `repeating_meleeweapons_${id}_meleeweaponname`); getAttrs(attrsToGet, function(weaponValues) { const steelClawExists = ids.some(id => weaponValues[`repeating_meleeweapons_${id}_meleeweaponname`] === 'Steel Claw'); const vorpalBladeExists = ids.some(id => weaponValues[`repeating_meleeweapons_${id}_meleeweaponname`] === 'Vorpal Blade'); let update = {}; let newRowId; // Define here to access later if (steelClawActive && !steelClawExists) { newRowId = generateRowID(); update[`repeating_meleeweapons_${newRowId}_meleeweaponname`] = "Steel Claw"; update[`repeating_meleeweapons_${newRowId}_meleeweapon`] = "Magic Talon"; update[`repeating_meleeweapons_${newRowId}_meleeabr`] = "1d12"; update[`repeating_meleeweapons_${newRowId}_meleedamage`] = "8"; update[`repeating_meleeweapons_${newRowId}_equippedmeleewep`] = "1"; } if (vorpalBladeActive && !vorpalBladeExists) { newRowId = generateRowID(); update[`repeating_meleeweapons_${newRowId}_meleeweaponname`] = "Vorpal Blade"; update[`repeating_meleeweapons_${newRowId}_meleeweapon`] = "Sword"; update[`repeating_meleeweapons_${newRowId}_meleeabr`] = "1d8"; update[`repeating_meleeweapons_${newRowId}_meleedamage`] = "4"; update[`repeating_meleeweapons_${newRowId}_magicmeleeweaponbonus`] = "3"; update[`repeating_meleeweapons_${newRowId}_equippedmeleewep`] = "1"; } setAttrs(update, function() { // Trigger the manual equip logic with a specific identifier setAttrs({ [`repeating_meleeweapons_${newRowId}_equippedmeleewep`]: "1", 'source': 'spell' // Custom identifier }); }); }); }); } else { getSectionIDs('repeating_meleeweapons', function(ids) { const attrsToGet = ids.map(id => `repeating_meleeweapons_${id}_meleeweaponname`); getAttrs(attrsToGet, function(weaponValues) { ids.forEach(id => { const weaponName = weaponValues[`repeating_meleeweapons_${id}_meleeweaponname`]; if (weaponName === "Steel Claw") { removeRepeatingRow(`repeating_meleeweapons_${id}`); } if (weaponName === "Vorpal Blade") { removeRepeatingRow(`repeating_meleeweapons_${id}`); } }); }); }); } }); }); on("change:repeating_meleeweapons:equippedmeleewep", function(event) { // Allow the specific sheetworker sources to trigger, prevent others if (event.sourceType === 'sheetworker' && !(event.sourceAttribute === 'source' && event.sourceValue === 'spell')) { return; } const playerclickedid = event.sourceAttribute.split('_')[2]; getSectionIDs("repeating_meleeweapons", function(ids) { const fieldnames = []; ids.forEach(id => fieldnames.push( `repeating_meleeweapons_${id}_equippedmeleewep`, `repeating_meleeweapons_${id}_meleeweaponname`, `repeating_meleeweapons_${id}_meleeweapon`, `repeating_meleeweapons_${id}_magicmeleeweaponbonus`, `repeating_meleeweapons_${id}_meleeabr`, `repeating_meleeweapons_${id}_meleedamage` )); getAttrs(fieldnames, values => { const output = {}; ids.forEach(id => { const checkbox = parseInt(values[`repeating_meleeweapons_${id}_equippedmeleewep`]) || 0; const meleeweaponname = values[`repeating_meleeweapons_${id}_meleeweaponname`] || "None"; const meleeweapontype = values[`repeating_meleeweapons_${id}_meleeweapon`] || "None"; const magicmeleeweaponbonus = parseInt(values[`repeating_meleeweapons_${id}_magicmeleeweaponbonus`]) || 0; const meleeabr = values[`repeating_meleeweapons_${id}_meleeabr`] || "0d0"; const meleedamage = values[`repeating_meleeweapons_${id}_meleedamage`] || "0"; if (id === playerclickedid) { if (checkbox) { output.equippedmeleeweaponname = meleeweaponname; output.equippedmeleeweapontype = meleeweapontype; output.equippedmeleeweaponmagicbonus = magicmeleeweaponbonus; output.equippedmeleeweaponabr = meleeabr; output.equippedmeleeweapondamage = meleedamage; } } else if (checkbox) { output[`repeating_meleeweapons_${id}_equippedmeleewep`] = 0; } }); setAttrs(output); }); }); });