Regulated secretion is an essential process where molecules destined for export are directed to membranous secretory granules, where they undergo packaging and maturation. Here, we identify a gene (pgant9) that influences the structure and shape of secretory granules within the Drosophila salivary gland. Loss of pgant9, which encodes an O-glycosyltransferase, results in secretory granules with an irregular, shard-like morphology, and altered glycosylation of cargo. Interestingly, pgant9 undergoes a splicing event that acts as a molecular switch to alter the charge of a loop controlling access to the active site of the enzyme. The splice variant with the negatively charged loop glycosylates the positively charged secretory cargo and rescues secretory granule morphology. Our study highlights a mechanism for dictating substrate specificity within the O-glycosyltransferase enzyme family. Moreover, our in vitro and in vivo studies suggest that the glycosylation status of secretory cargo influences the morphology of maturing secretory granules.