Can't set table stuff

PropertyData[Category][PropertyName]
will error with something such as “can’t find propertyname”
using table[key] is supposed to replace the key or add it if not already. but when I do table[key][val] it is expecting val to exist already. why isn’t it just make a new value?

PropertyData[Category] works fine and adds the data if it doesn’t exist.

Nevermind. I had done local PropertyData earlier in the script and was looping through a table using the variables PropertyData.