Need help on getting folder id

I have a macro that gets assembly content item folder id using $sys.assemblyItem.folderId. For certain reason, it works perfectly in one community but not the others. Does anybody know what is missing that caused $sys.assemblyItem.folderId to stop working?

I’m still waiting for a solution for it. Please help.