{"id":181,"date":"2011-11-01T11:32:40","date_gmt":"2011-11-01T15:32:40","guid":{"rendered":"http:\/\/www.dontpapanic.com\/blog\/?p=181"},"modified":"2011-11-01T11:34:35","modified_gmt":"2011-11-01T15:34:35","slug":"sharepoints-managed-metadata-service-is-not-case-sensitive","status":"publish","type":"post","link":"https:\/\/www.dontpapanic.com\/blog\/?p=181","title":{"rendered":"SharePoint&rsquo;s Managed Metadata service is NOT case sensitive"},"content":{"rendered":"<p>I\u2019ve done programming in a variety of environments over the years.&#160; Case sensitivity was one of the things that was the most difficult for me to get used to when I moved from VB to C# a number of years ago.&#160; In fact if it weren\u2019t for Intellisense I would probably still be swearing at C# on a regular basis. I\u2019ve learned to live with, and even make use of, case sensitivity in my C# programs over the years.&#160; But it doesn\u2019t come naturally.&#160; I still tend to think in a case insensitive fashion.&#160; <\/p>\n<p>As a result I was somewhat surprised to run into someone having an issue recently when trying to add SharePoint Managed Metadata terms to a user profile programmatically.&#160; They reported that SharePoint wasn\u2019t consistent when adding terms to the <em><strong>Ask me About<\/strong><\/em> profile field programmatically.&#160; It turns out that the real problem was that they had duplicate fields where the only difference was the case of the first character of the abbreviation.&#160; After some investigation here\u2019s what I discovered.<\/p>\n<ol>\n<li>SharePoint won\u2019t let you add two metadata terms under the same parent if the only thing that differs is the case sensitivity of the term.&#160; The image below shows what happens if you try to add \u201cABC\u201d as a term when \u201cAbc\u201d already exists under the same parent term.\n<p><a href=\"http:\/\/www.dontpapanic.com\/blog\/wp-content\/uploads\/2011\/11\/mms-error1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"mms error1\" border=\"0\" alt=\"mms error1\" src=\"http:\/\/www.dontpapanic.com\/blog\/wp-content\/uploads\/2011\/11\/mms-error1_thumb.png\" width=\"640\" height=\"260\" \/><\/a>      <\/li>\n<li>You can add (but probably shouldn\u2019t) a term that differs only based on case sensitivity if you also change the hierarchy that the term inherits from.&#160; The image below shows the same \u201cABC\u201d term added to a different parent.&#160; This time the addition is successful.\n<p><a href=\"http:\/\/www.dontpapanic.com\/blog\/wp-content\/uploads\/2011\/11\/MMS-21.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"MMS 2\" border=\"0\" alt=\"MMS 2\" src=\"http:\/\/www.dontpapanic.com\/blog\/wp-content\/uploads\/2011\/11\/MMS-2_thumb1.png\" width=\"640\" height=\"211\" \/><\/a>      <\/li>\n<li>When you try to add any combination that starts with abc to a managed metadata column you get both terms.&#160; You can of course choose the one you actually want, but that\u2019s based on the hierarchy of the term, not its case sensitivity.\n<p><a href=\"http:\/\/www.dontpapanic.com\/blog\/wp-content\/uploads\/2011\/11\/mms31.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"mms3\" border=\"0\" alt=\"mms3\" src=\"http:\/\/www.dontpapanic.com\/blog\/wp-content\/uploads\/2011\/11\/mms3_thumb1.png\" width=\"640\" height=\"300\" \/><\/a>      <\/li>\n<\/ol>\n<p>The lesson here is that unlike some things like C#, the Managed Metadata service is NOT case sensitive.&#160; You should try to avoid adding terms to the service that differ only based on case sensitivity.&#160; This is particularly true if you intend to add managed metadata to fields programmatically.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve done programming in a variety of environments over the years.&#160; Case sensitivity was one of the things that was the most difficult for me to get used to when I moved from VB to C# a number of years ago.&#160; In fact if it weren\u2019t for Intellisense I would probably still be swearing at &hellip; <a href=\"https:\/\/www.dontpapanic.com\/blog\/?p=181\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SharePoint&rsquo;s Managed Metadata service is NOT case sensitive<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[19,53,6,51],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-sharepoint-2010-dev","tag-development","tag-managed_metadata","tag-sharepoint_2010","tag-user_profiles"],"_links":{"self":[{"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":1,"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/186"}],"wp:attachment":[{"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dontpapanic.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}