{"id":8872,"date":"2016-04-19T12:49:20","date_gmt":"2016-04-19T12:49:20","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/sharepoints-way-of-saying-your-string-is-too-long\/"},"modified":"2016-07-28T10:58:01","modified_gmt":"2016-07-28T10:58:01","slug":"sharepoints-way-of-saying-your-string-is-too-long","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/sharepoints-way-of-saying-your-string-is-too-long\/","title":{"rendered":"SharePoint&rsquo;s Way of Saying Your String is Too Long"},"content":{"rendered":"<p>I accidentally defined a field in a SharePoint list as a text field instead of a multiline text field and when I went to save a very long XML string into that field I received the following message:<\/p>\n<p><strong>Invalid text value. A text field contains invalid data. Please check the value and try again.<\/strong><\/p>\n<p>Since this was XML my developer brain immediately began thinking about which part of the XML was mangled and how that was happening.&#160; After about 10 minutes of looking through the XML generation I stopped and wondering why the heck SharePoint was even parsing my XML.&#160; And then it dawned on me that it wasn&#8217;t and that there was some other problem.&#160; So, long story short, if you see this message it may simply mean that your string is too long.<\/p>\n<p>To be fair, the UI gives you a much better error, but I was updating the list item programmatically.&#160; It really would be nice, however, if the error message was more accurate.&#160; Hint, hint, Microsoft.<\/p>\n<p><strong>NOTE<\/strong>: this error is fairly generic and does not ALWAYS mean that your string is too long. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I accidentally defined a field in a SharePoint list as a text field instead of a multiline text field and when I went to save a very long XML string into that field I received the following message: Invalid text value. A text field contains invalid data. Please check the value and try again. Since&#8230;&hellip;<\/p>\n","protected":false},"author":46738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-8872","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/8872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/46738"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=8872"}],"version-history":[{"count":3,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/8872\/revisions"}],"predecessor-version":[{"id":42543,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/8872\/revisions\/42543"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=8872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=8872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=8872"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=8872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}