Parse managed metadata

Hi,

I have a managed metadata column that i want to change the colon (:) seperator to dash(-) . for example the current way: QM:QA|07b37186-5c39-4af5-9697-1584621380da to QM-QA

Is that doable?

Thanks a lot in advacne

August 30th, 2015 5:06am

Hi arevach,

According to your descriptions, do you want to change the display format when displaying the entire path to the term in the metadata column?

If this is your requirement, there is no OOB feature in SharePoint can help us to achieve it.

As an alternative, we can try to change the colon to dash via JS link.

Here is my code for your reference:

 (function () { 

    var filedContext = {}; 

    filedContext.Templates = {};

    filedContext.Templates.Fields = {  

        "metadata": { "View": customValue }

    }; 

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(filedContext); 

})(); 

function customValue(ctx) {

    var content = ctx.CurrentItem[ctx.CurrentFieldSchema.Name].Label;

    console.log(content);

    if(content != null){   

        content = content.replace(":", "-"); 

    }

    console.log(content);

    return content;

}

Best regards,

Linda Zhang

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 9:48pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics