sort tags and map names for value input