I have a few repeating sections to help organize inventory. <fieldset class="repeating_inventorycombat"> <input name="attr_inventoryslots"/><button type="action" name="act_usage">Use</button> </fieldset> <fieldset class="repeating_inventoryconsumables> <input name="attr_inventoryslots"/><button type="action" name="act_usage">Use</button> </fieldset> The Use button should get the value of " inventoryslots" on the relevant line and do some stuff with it. I could write a different sheet worker for each section (which are otherwise identical), but I'd prefer to have them all the same. I've gotten as far as being able to identify which button was clicked, but I can't seem to get the inventoryslots value. on('clicked:repeating_inventorycombat:usage clicked:repeating_inventoryconsumable:usage clicked:repeating_inventorygeneral:usage clicked:repeating_inventorycarriedloot:usage clicked:repeating_inventoryephemera:usage clicked:repeating_inventorystored:usage', (eventInfo) => { const trigger = eventInfo.sourceAttribute.split('_'); const list = trigger[1] const rowid = trigger[2] const item ='repeating_'+list+'_'+rowid+'_inventoryslots' setAttrs({
testfield1: (eventInfo.sourceAttribute),
testfield2: item
});
});
How do I use the variable "item" get get the actual value? I tried getAttrs([`$(item)`], function(values) { and testfield2: `values.${item}` but testfield2 shows the item string ( repeating_inventorycombat_somerowid_usage ) rather than value of the variable (a value like 3 ) . I feel like I'm close, but can't quite cross the finish line. If I can sort this, I have 2 or 3 use cases to tighten up this character sheet. Thanks!