Hello, I have a problem with a repeatingSum function. I have code it same as usual but it's not functionnal. Here the code. The code with the total value : < div class = "charsheet-size" > <!--Beginning of character sheet--> <!--Beginning of character description--> < div id = "character_description" > < div class = 'sheet-2colrow' > <!--Left column--> ... <!--Right column--> < div class = "sheet-col" style = " margin-left: 0px; width: 573px;" > < input type = "text" class = "cell-name-2col" value = "Character Backstory" /> < input type = "text" class = "cell-content-2col" name = "attr_CharacterBackstory" />< br > < input type = "text" class = "cell-name-2col" value = "Character Personality" /> < input type = "text" class = "cell-content-2col" name = "attr_CharacterPersonality" />< br > < input type = "text" class = "cell-name-2col" value = "Character Appearance" /> < input type = "text" class = "cell-content-2col" name = "attr_CharacterAppearance" />< br > < input type = "text" class = "cell-name-2col" value = "Current Level" /> <!--Total value--> < input type = "number" class = "cell-content-2col" name = "attr_CurrentLvl" readonly = "readonly" />< br > < input type = "text" class = "cell-name-2col" value = "Current Maximum Power" /> < input type = "text" class = "cell-content-2col" name = "attr_CurrentMaxPwr" />< br > < input type = "text" class = "cell-name-2col" value = "Specific Attempts" /> < input type = "text" class = "cell-content-2col" name = "attr_SpecAttempts" /> </ div > </ div > The code of the repeating section : < fieldset class = "repeating_characteristic" > < div class = "dark-row" style = " margin-bottom: 2px;" > < div class = 'sheet-2colrow' > <!--Left column--> < div class = "sheet-col" style = " background-color: #B6D7A8; width: 650px; margin-right: 0px;" > < input class = "textbox" type = "text" name = "attr_CharacteristicName" value = "Name" style = " margin-left: 10px;" /> < button type = "roll" title = "PowerRoll" name = "roll_CharacteristicPower" style = " margin-left: 15px;" value = "&{template:default} {{name=@{CharacteristicName &#125; }} {{Power=[[1d@{CharacteristicPower}]]}}" ></ button > < input class = "textbox" type = "number" name = "attr_CharacteristicPower" value = "0" /> < button type = "roll" title = "ControlRoll" name = "roll_CharacteristicProficiency" style = " margin-left: 10px;" value = "&{template:default} {{name=@{CharacteristicName &#125; }} {{Proficiency=[[1d@{CharacteristicProficiency}]]}}" ></ button > < input class = "textbox" type = "number" name = "attr_CharacteristicProficiency" value = "0" style = " margin-left: 0px;" /> < button type = "roll" title = "ControlRoll" name = "roll_CharacteristicControl" style = " margin-left: 5px;" value = "&{template:default} {{name=@{CharacteristicName &#125; }} {{Control=[[1d@{CharacteristicControl}]]}}" ></ button > < input class = "textbox" type = "number" name = "attr_CharacteristicControl" value = "0" /> < input class = "textbox" type = "number" name = "attr_CharacteristicMass" value = "0" style = " margin-left: 2px;" /> < input class = "textbox" type = "number" name = "attr_CharacteristicLength" value = "0" /> < input class = "textbox" type = "number" name = "attr_CharacteristicWidth" value = "0" style = " margin-left: 2px;" /> <!--Total of values in the repeating section--> < input class = "textbox" type = "number" name = "attr_CharacteristicLevel" value = "(@{CharacteristicPower}+@{CharacteristicProficiency}+@{CharacteristicControl}+@{CharacteristicMass}+@{CharacteristicLength}+@{CharacteristicWidth})" disabled = "disabled" /> </ div > <!--Right column--> < div class = "sheet-col" style = " background-color: #FFE599; width: 492px; margin-left: 0px;" > < input class = "textbox" type = "number" name = "attr_CharacteristicQuantity" value = "0" style = " margin-left: 9px;" /> < input class = "textbox" type = "number" name = "attr_CharacteristicDamage" value = "0" style = " margin-left: 17px;" /> < input class = "textbox" type = "number" name = "attr_CharacteristicComplexity" value = "0" style = " margin-left: 25px;" /> < input class = "textbox" type = "text" name = "attr_CharacteristicPosition" value = "Position" style = " width: 105px; margin-left: 15px;" /> < input class = "textbox" type = "text" name = "attr_CharacteristicDescription" value = "Description" /> </ div > </ div > </ div > </ fieldset > The code of the repeatingSum script : < script type = "text/worker" > /* ===== PARAMETERS ========== destinations = the name of the attribute that stores the total quantity can be a single attribute, or an array: ['total_cost', 'total_weight'] If more than one, the matching fields must be in the same order. section = name of repeating fieldset, without the repeating_ fields = the name of the attribute field to be summed destination and fields both can be a single attribute: 'weight' or an array of attributes: ['weight','number','equipped'] */ const repeatingSum = (destinations, section, fields) => { if (!Array.isArray(destinations)) destinations = [destinations.replace(/\s/g, '').split(',')]; if (!Array.isArray(fields)) fields = [fields.replace(/\s/g, '').split(',')]; getSectionIDs(`repeating_${section}`, idArray => { const attrArray = idArray.reduce((m, id) => [...m, ...(fields.map(field => `repeating_${section}_${id}_${field}`))], []); getAttrs([...attrArray], v => { const getValue = (section, id, field) => v[`repeating_${section}_${id}_${field}`] === 'on' ? 1 : parseFloat(v[`repeating_${section}_${id}_${field}`]) || 0; const commonMultipliers = (fields.length <= destinations.length) ? [] : fields.splice(destinations.length, fields.length - destinations.length); const output = {}; destinations.forEach((destination, index) => { output[destination] = idArray.reduce((total, id) => total + getValue(section, id, fields[index]) * commonMultipliers.reduce((subtotal, mult) => subtotal * getValue(section, id, mult), 1), 0); }); setAttrs(output); }); }); }; //Current level value on('change:repeating_characteristic remove:repeating_characteristic', function() { repeatingSum("CurrentLvl","characteristic","CharacteristicLevel"); }); </ script >