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 am making a SharePoint app with javascript.

I am trying to add a list item to a list I have defined in Visual Studio. I have done this just by adding a list in the solution explorer, and I made some custom columns in the graphical view. This is actually where I suspect my error could be located. Is this how I define my columns? My code looks like this

var oListItem = null;
function createListItem() {
    var oList = clientContext.get_web().get_lists().getByTitle('List');
    var itemCreateInfo = new SP.ListItemCreationInformation();
    oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Car', 'My New Item');

        Function.createDelegate(this, onQuerySucceeded),
        Function.createDelegate(this, onQueryFailed)

function onQuerySucceeded() {
    alert('Item created: ' + oListItem.get_id());

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() +
        '\n' + args.get_stackTrace());

I am able to print out the list and the fields, but I am not able to add the item like this. I get an error telling me:

Request failed. Column 'Car' does not exist. It may have been deleted by another user.

What can I do to be able to add some items to my list? Do I have to define my list otherwise?

share|improve this question

The code should work I think. You haven't just changed the Title field to Car ? If so, the internal name of the column is still Title, and you need to use that:

oListItem.set_item('Title', 'My New Item');

If not, double check that the internal name of the field is actually Car

share|improve this answer

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.