It looks like the issue is missing backtick quotes and curly brackets here: getAttrByName(character.id,`repeating_ranged_ ${rowid}_notes` ); However I notice you have a function at the top of your script that makes it easy to get this right. This bit: const rangedBuilder = (rowid, atk) => `repeating_ranged_${rowid}_${atk}`; That's a function designed to let you build the repeating attribute names correctly. You call it like so: let fieldName = rangedBuilder(rowid,'notes'); That will give you a variable that contains the properly formatted name, and can replace your getAttrByname line with getAttrByName(character.id,fieldName); You can also combine those two stepsinto a single operation like so getAttrByName(character.id,rangedBuilder(rowid,'notes')); So putting that all together, the line that's giving you issues would become: var note = getAttrByName(character.id,rangedBuilder(rowid,'notes'));