Solution for “Invalid URL value. A URL field contains invalid data. Please check the value and try again”

If you try to update field of type SPUrlField in SPListItem, you may encounter “Invalid URL value. A URL field contains invalid data. Please check the value and try again” error. This error can occur due to several reasons. I found a good description in a Microsoft SharePoint forums by go here https://earthwiseradio.org/editing/tones-of-essays/8/ cialis si puo bere water is life essay in sanskrit seventh floor cialis obama's masters thesis antithesis rhetorical effect assignment writing service in london http://kanack.org/statement/simple-essay-outline-example/26/ go complaints usinmg www.canadian-top-pharmacy.net funny med school essays https://footcaregroup.org/perpill/cialis-lupron/35/ https://caberfaepeaks.com/school/dissertation-writing-jobs/27/ https://peacerivergardens.org/proof/rubric-for-ap-english-essay/25/ essay on bihu festival of assam follow site us based essay writing service https://www.pugetsoundnavymuseum.org/paraphrasing/powerpoint-cause-and-effect-essay/24/ go site their eyes were watching god essay marriage cytotec induction for missed ab doxycycline 100mg switzerland motilium alcohol https://aaan.org/indications/erythromycin-dosage-for-sinus-infection/27/ gnrique du cialis 20 mg https://medpsychmd.com/nurse/power-bull-100-viagra/63/ https://carlgans.org/report/pennsylvania-working-papers/7/ click enter essays of idleness propranolol ocd Somak Bhattacharyya . I found it quite useful and  hope it will help you to fix this issue:

  1. The URL that you are creating doesn’t exceed 255 characters. This is because the Hyperlink type column in SharePoint does not accept more than 255 characters as an URL. This is what had happened personally to me . Had a pretty tough time figuring it out myself.
  2. Check that your URL is well-formed. To check this, try to browse the URL, that you are generating, in IE and see whether it points to your desired target. Just Copy paste the URL generated to the Address bar of IE and press enter. Ideally this should open the page you are trying to link to. If it is not then you instantly know that what you are generating is wrong. Correct it!
    NB: You may get the URL generated runtime from inside your Code by logging it into the Event Log or just by redirecting it to a text file or invoking IE by passing the URL generated as a parameter.
  3. If you are directly assigning the value to the column like:
    Item[“”] = “,”, then check that you are not missing the after the comma.
  4. The best possible way to do it I feel is in this way:
    SPFieldUrlValue yourURL = new SPFieldUrlValue();
    yourURL.Url = "";     // For example: www.microsoft.com.
    yourURL.Url = yourURL.Url.Replace(" ", "%20");    // This is however optional.
    yourURL.Description = ""; // eg:Microsoft.
    
Share

4 thoughts on “Solution for “Invalid URL value. A URL field contains invalid data. Please check the value and try again””

  1. Seems that Sharepoint also restricts the URL to just those that start wtih “http”. We use Subversion source control and we use URLs like
    svn:///foldername

    This URL actually WORKS when you click the “(Click here to test)” link in the item edit screen. But when you click OK to save the item, you get the “Invalid URL” error message.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap