There are a few issues with your sheet worker. Youre missing an open quote at the start of sheet:opened. The character_name attribute is a string - its text. parseInt is only for numbers (specifically integers) - you use it to extra numbers from strings. Since attribute values are stored as text, you dont need an equivalent to parseInt. Your substr function references a codeLine variable, but there isnt one. Here's a fixed version of the sheet worker, that also handles if a character sheet name is changed while the sheet is open. It uses a different version to calculate rolln, but substr is fine. I just prefer this way. Also, you might want a function to strip the rolln of special characters like quotes, to avoid weirdness and errors. on('change:character_name sheet:opened', () => { getAttrs(['character_name'], v => { let fulln = v.character_name; let rolln = fulln.split(' ')[0]; setAttrs({ roller: rolln }); }); });