Trimming metadata field values to different lenghts depending on the type of the field