Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9176607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:08:36+00:00 2026-06-17T17:08:36+00:00

Trying to create a new list item in and store the created item’s ID

  • 0

Trying to create a new list item in and store the created item’s ID in a variable for later usage. (in SharepointOnline 2010)
I’m able to create the item perfectly fine but not able to get the ID of the resulting object.

My current solution is to make an ajax request using UpdateListItems to create the item and then in the success callback function try find and ID in the resulting object.

 var onsuccessArg = function (data) {
        $(data).find('z\\:row').each(function () {
            savedItemID = $(this).attr('ows_ID');
        });
    };

So the list item is created successfully and onSuccess is called. But the each clause is never entered.
At first I thought there was a browser issue with find('z\\:row') but I’ve looked at the data object it in the chrome debugger and I can see that while a <z:row> element does exist it does not contain any child nodes! So it’s like the service hasn’t returned any items, even though it did create a list item successfully.
Why could that be?

I Should I be able to get the created list item id this way, right? Am I just missing something or is my approach incorrect?
Could there be some weird issue with the server that’s causing this? I think that this code has been working fine previously

Edit: For some reason not able to paste the entire code into the post. So here’s a pastebin instead http://pastebin.com/iGrvytgn

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:08:37+00:00Added an answer on June 17, 2026 at 5:08 pm

    Like Eric said, the ID field SHOULD be specified but it doesn’t seem to be required. I’ve managed to execute the UpdateListItems command perfectly fine both with or without it…

    But I found 2 other problems with the code in my first post:

    1. $(data).find('z\\:row') doesn’t work in chrome. Had to append the line $(data.responseText).find('z\\:row') .
      Turns out that chrome places data in a different property than other browsers. It uses responseText property rather than responseXML property. and `$(data).find(‘z\:row’) will not find anything in the responseText property.
      This was quite the head scratcher, cause when I checked the chrome debugger I could still see that responseXML property was present and contained all the expected nodes, just missing any data such as ows_ID.

    2. The callback function (function(data,status) ) didn’t have to correct parameters to be used as the success function of the ajax call. The response data of an ajax call is placed in the jqXHR object. I thought this object was always the first parameter, but turns out the parameter list is different for success and complete .

      • Complete is defined as: Function( jqXHR jqXHR, String textStatus )
      • Success is defined as:
        Function( Object data, String textStatus, jqXHR jqXHR )

    So to use my callback as the success function it’s header should be function(obj,status,data) .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a new dict using a list of values of
I am trying to create a list that adds a new row of data
I'm trying to generate a new SharePoint list item directly using SQL server. What's
I am trying to create several new lists from one master list whereby the
Im trying to create new file on D: drive with c/c++ I found this
I am now trying to create new database manager under Fragment class. But unfortunately,
I am trying to create new Event objects to be persisted in the database
I am trying to create new rules profile in Sonar 2.9 with my checkstyle
Trying to create a new Dedicated Cache Role in Windows Azure but get the
When trying to create a new team project with any of the default project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.