SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list with a title and a url. I'm trying to add a new url using this function

function addListItem(url, listname, metadata, success, failure) {

    // Prepping our update
    var item = $.extend({
        "__metadata": { "type": getListItemType(listname)}
    }, metadata);

    // Executing our add
        url: url + "/_api/web/lists/getbytitle('" + listname + "')/items",
        type: "POST",
        contentType: "application/json;odata=verbose",
        data: JSON.stringify(item),
        headers: {
            "Accept": "application/json;odata=verbose",
            "X-RequestDigest": $("#__REQUESTDIGEST").val()
        success: function (data) {
            success(data); // Returns the newly created list item information
        error: function (data) {


I can set the title using this metadata item:

metadata = { Title: 'myTitle' }

But how can I set the url in this context? This doesn't work:

metadata = { Title: 'myTitle', Url: 'http://myspurl' }
share|improve this question
as per your program you can only pass one parameter in metadata? – SharePointHacker Apr 7 '14 at 10:26
up vote 5 down vote accepted

In order to set Url Field value in SharePoint REST specify the following JSON object:

URL: {Url: '',Description: 'MSFT'}

where URL is the name of a field.


var metadata = { Title: 'myTitle', URL: {Url: '',Description: 'MSFT'}};
share|improve this answer
Or simply URL: ", Google" – Arsalan Adam Khatri Apr 7 '14 at 11:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.