{"id":3676,"date":"2019-11-25T07:40:16","date_gmt":"2019-11-25T07:40:16","guid":{"rendered":"http:\/\/himbap.com\/blog\/?p=3676"},"modified":"2019-11-25T07:40:16","modified_gmt":"2019-11-25T07:40:16","slug":"fixing-expected-non-empty-string-regarding-optionset","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=3676","title":{"rendered":"Fixing : Expected non-empty string regarding OptionSet"},"content":{"rendered":"<p><strong>Introduction<\/strong><br \/>\nThis is quick post about fixing &#8220;<strong>Expected non-empty string&#8221;<\/strong> error. If you are facing same issue this post going to help you!.<\/p>\n<p><strong>Solution<\/strong><br \/>\nRecently while removing option from option set which seems to be added during data import, we got this &#8220;<strong>Expected non-empty string<\/strong>&#8220;. First we tried to search regarding this error if someone got it already, we found this error is kind of generic error which we can get for multiple reasons but we did not find any solution which was matching our issue.<\/p>\n<p>When we downloaded error log, we saw following details:<br \/>\n&#8220;<strong><Message>Expected non-empty string.<\/Message><br \/>\n  <Timestamp>2019-11-25T06:47:17.4217082Z<\/Timestamp><br \/>\n  <ExceptionRetriable>false<\/ExceptionRetriable><br \/>\n  <ExceptionSource i:nil=\"true\" \/><br \/>\n  <InnerFault><br \/>\n    <ActivityId>d8ab7ce4-5ded-49f8-bd8c-d594c1a36cba<\/ActivityId><br \/>\n    <ErrorCode>-2147220970<\/ErrorCode><br \/>\n    <ErrorDetails xmlns:d3p1=\"http:\/\/schemas.datacontract.org\/2004\/07\/System.Collections.Generic\" \/><br \/>\n    <HelpLink i:nil=\"true\" \/><br \/>\n    <Message>System.ArgumentException: Expected non-empty string.<br \/>\nParameter name: label<\/Message><\/strong>&#8221;<\/p>\n<p>Based on the error message, we thought of checking option set metadata by exporting entity, so we created a custom solution and added this single entity and single option set field. After extracting zip file when we checked this option set metadata under customization.xml, we found some options are available under this field which don&#8217;t have any label like following<\/p>\n<p><a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/11\/optionseterror.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/11\/optionseterror-300x178.png\" alt=\"optionseterror\" width=\"300\" height=\"178\" class=\"alignnone size-medium wp-image-3677\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/11\/optionseterror-300x178.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/11\/optionseterror-624x370.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2019\/11\/optionseterror.png 738w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>To fix this issue we added a dummy label to these options and imported solution back to Dynamics 365 CE organization. After that we were able to delete unwanted options without any issue. <\/p>\n<p>Hope it will help someone!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This is quick post about fixing &#8220;Expected non-empty string&#8221; error. If you are facing same issue this post going to help you!. Solution Recently while removing option from option set which seems to be added during data import, we got this &#8220;Expected non-empty string&#8220;. First we tried to search regarding this error if someone got it already, we found&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=3676\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[402],"tags":[723,724],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3676"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3676"}],"version-history":[{"count":6,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3676\/revisions"}],"predecessor-version":[{"id":3683,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3676\/revisions\/3683"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}