Insert data to Sharepoint 2019 type Hyperlink over SOAP

Ladislav Zelinka 51 Reputation points
2023-01-10T12:00:46.457+00:00

Hi. How to insert new data to ListItem type Hyperlink This work not: <?xml version='1.0' encoding='utf-8'?> <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> <soap:Body> <UpdateListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> <listName>{f6a35e7d-2cfe-4c54-980f-32652b8da798}</listName> <updates><Batch OnError='Continue' ListVersion='1'><Method ID='1' Cmd='New'> <Field Name='ID'>New</Field> <Field Name='Test'>'https://www.yahoo.com'</Field> </Method></Batch></updates> </UpdateListItems> </soap:Body> </soap:Envelope>

Response is: Invalid URL value. Hyperlink need Url and Description, but how ? I can't find relevant answear.

Thanks.

Microsoft 365 and Office SharePoint Development
{count} votes

Accepted answer
  1. Tong Zhang_MSFT 9,251 Reputation points
    2023-01-11T09:06:34.0266667+00:00

    Hi @Ladislav Zelinka,

    Based on my research and testing, please try to do a troubleshooting: check if the column name has changed? If you change the column name, it keeps the old name in the background, so the "field name" should be the original old name.

    In addition, if you need to insert a hyperlink through SOAP, please refer to the following format:

    <Field Name='Test'>https://www.yahoo.com, Description</Field>
    

    Hope it can help you. Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Ladislav Zelinka 51 Reputation points
    2023-01-12T12:05:47.78+00:00

    Thanks, It's work.

    0 comments No comments

  2. Ladislav Zelinka 51 Reputation points
    2023-01-12T12:54:41.21+00:00

    Work not for registred URI link.

    URI Link like tel: or mailto: work well, but other not.

    Is there any possibility to enter a other URI link in the field?

    Error: "Invalid URL value. A URL field contains invalid data."

    or can I enable it somewhere on onprem SHP 2019 ?

    Thanks.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.