Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Getting Calculated Attribute Value In A SheetWorker

1781182160

Edited 1781182253
Coryphon
Pro
Sheet Author
Compendium Curator
Hi there, I've been doing character sheets for a while, but this one has me stumped.... I have a repeating group which has an attribute set from other attributes in the value field (see code below)... In my sheetworker, if I try and get this value it just returns me the formula string... <fieldset class="repeating_athleticsspec"> <div class="sheet-laf-centredgrid sheet-laf-4colrow1311">     <button name="roll_Athleticsspec" type="roll" value="@{whispertoggle}&{template:skill-general-alt} {{skill=^{athletics-u}}} {{spec=: @{skillSpeciality-Athleticsspec} }} {{character= @{character_name} }} @{ro_default_rolltype} + [[@{skilltotal-Athleticsspec}]] @{ro_default_mod}]] }} ">     <div class="sheet-button_header_rep">b</div></button>     <input type="text" class="sheet-input" name="attr_skillSpeciality-Athleticsspec" placeholder="Specialty Name"/>     <input type="number" class="sheet-input" name="attr_skilllevel-Athleticsspec" value="0"/>     <input type="number" class="sheet-input" name="attr_skilltotal-Athleticsspec" value="@{skillCharacteristicDM-Athletics} + @{skilllevel-Athleticsspec} + @{skilllevel-Athletics} + @{skillmodifier-Athletics}" disabled/>     </div> </fieldset> You can see that  attr_skilltotal-Athleticsspec  is the field with a formula in it, and as mentioned, doing a getAttrs just returns the formula string... I tried adding a hidden field like: <input type="hidden" name="skilltotalconst-Athleticsspec" value="@{skilltotal-Athleticsspec}"> But this never gets a value so I guess it can't be used in this way... Is there any way to get the resolved value of  attr_skilltotal-Athleticsspec? Obviously I can re-do the calc myself in the sheetworker but it's a bit of a pain :-)) Any help very gratefully received, ~ Coryphon ~ PS I'm aware of case-sensitivitiy and that the variables have to be lower-cased within the getAttrs array of things to return!
1781184486
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Sheetworkers don't play well with autocalcs. You'll need to switch those to read-only and calculate them via sheetworker as well. As a bonus, your sheet will also be more performant without auto calcs.
1781185056
Coryphon
Pro
Sheet Author
Compendium Curator
Thanks Scott, I thought as much… Yeah, inherited these fields so need to refactor at some point! Cheers, ~ C ~
1781185406
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Good luck! Refactors are always a pain.