Update template.js

Handle situation where not itemdata is found for the appid