2

I am trying to add new item to list, this is request

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap1="http://schemas.microsoft.com/sharepoint/soap/">
   <soap:Header/>
   <soap:Body>
      <soap1:UpdateListItems>
         <!--Optional:-->
         <soap1:listName> --LIST_GUID_COMES_HERE-- </soap1:listName>
         <!--Optional:-->
         <soap1:updates>
         <Batch OnError="Continue" ListVersion="1" 
            ViewName="--VIEW_GUID_COMES_HERE--">         
          <Method ID='1' Cmd='New'>
            <Field Name='ows_Date'>03/09/2016</Field>           
            <Field Name='ows_Type'>TEST</Field>                     
            <Field Name='ows_Title'>0000</Field>
            </Method> 
          </Batch>
         </soap1:updates>
      </soap1:UpdateListItems>
   </soap:Body>
</soap:Envelope>

And this is respond:

   <soap:Body>
      <UpdateListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
         <UpdateListItemsResult>
            <Results>
               <Result ID="1,New">
                  <ErrorCode>0x81020014</ErrorCode>
                  <ErrorText>One or more field types are not installed properly. Go to the list settings page to delete these fields.</ErrorText>
               </Result>
            </Results>
         </UpdateListItemsResult>
      </UpdateListItemsResponse>
   </soap:Body>

The error is not very informative. How can identify the issue?

  • Are you able to add list item using out of the box New Item Form? – Amal Hashim Mar 19 '15 at 14:35
  • I can add, some concerns I am not sure which fields are mandatory, the name of fields I took from calling GetListItems soap – yuris Mar 19 '15 at 15:05
1

To verify:

  • Name attribute for Field element accepts field internal name, so make sure the valid field internal name is specified (i guess in your case it should be Date, Type and Title instead of ows_Date, ows_Type and ows_Title)
  • Specify date field value in ISO format, for example 2016-03-09T00:00:00Z
  • Since ViewName attribute of Batch element is ignored in UpdateListItems operation it could be omitted

Fixed example

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap1="http://schemas.microsoft.com/sharepoint/soap/">
   <soap:Header/>
   <soap:Body>
      <soap1:UpdateListItems>
         <!--Optional:-->
         <soap1:listName>--list guid/name goes here--</soap1:listName>
         <!--Optional:-->
         <soap1:updates>
         <Batch OnError="Continue" ListVersion="1">         
          <Method ID='1' Cmd='New'>
            <Field Name='Date'>2016-03-09T00:00:00Z</Field>           
            <Field Name='Type'>TEST</Field>                     
            <Field Name='Title'>0000</Field>
            </Method> 
          </Batch>
         </soap1:updates>
      </soap1:UpdateListItems>
   </soap:Body>
</soap:Envelope>

How to retrieve field names from List

Using GetList operation you could retrieve field names from Name attribute in Field element:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
   <soapenv:Header/>
   <soapenv:Body>
      <soap:GetList>
         <!--Optional:-->
         <soap:listName>--list guid/name goes here--</soap:listName>
      </soap:GetList>
   </soapenv:Body>
</soapenv:Envelope>
  • Can you please explain what is 'field internal name'? Why when I call GetListItems api it doesn't return me the internal name? – yuris Mar 19 '15 at 18:21
0

I had to solve the same problem using SOAP-UI. You have to use internal field names which are not the same as you get by GetListItems. The best way to get internal field names is described here: https://social.msdn.microsoft.com/Forums/sharepoint/en-US/75ca6fab-56f3-4bf4-aae0-2d29821778a2/how-to-get-internal-names-of-columns-in-sharepoint-lists

Sharepoint puts some ows_ prefix to field names when returning XML containing list. Hard to undestand for me, but it is as it is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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