How to generate 'categ' field?