Example of Calling SharePoint WebService to update List Title

  • 24 December 2015
  • 4 replies
  • 1 view

Badge +2

Does anyone know of an example to call the SharePoint WebService to update a Lists Title? I am creating a document library for clients with abbreviations to remove invalid characters and shorten the URL, but I need the name to be reflected correctly on the screen.


4 replies

Userlevel 7
Badge +17

There are a few ways to make this happen, web service to Lists.asmx, REST api, using the gui,  and PowerShell. But which method is required? Do you need to do this through a workflow, script, or scheduled automation?

Badge +2

My goal is to create the list (which it does) using the client ID, then change the description to the company name using a scheduled workflow that checks for new clients. I have everything working except the name change piece. I need to find a way to grab the list GUID and use web service call to change the name. It would be great to have the list creation call return the new GUID (much like adding a calendar entry) but I have not found a way to do that.

Badge +5

Ben, if you're using the Webs.asmx in the web call, there aren't many methods that are writeable, most are read-only. Our solution for this was to use PowerShell scripts once the base site was created using the Create Site action. We use the Power Activity tool from Data One that allows us to run powershell scripts from inside Nintex workflows. This has greatly extended our automation of site creation and the many objects created on each site.

Good luck,

Gerard

Badge +11

Hi Ben,

if you create the list via a webservice call as well, you will receive a xmlnode as response that includes the GUID of the newly created list.

So you can use http://<site>/_vti_bin/Lists.asmx in your webservice call and chose the addlist-method to create your new list. Make sure to configure your call webservice action to store the result in a variable. You can then use for example the Query XML action to use XPath to extract the GUID from the web service result and store it in another variable and use it in a later step to update your list.

If  you only have the name of the list available, you can use the getList-method of the same webservice. This method takes the list name as parameter and also returns a xmlnode as response including the GUID.

See MSDN for further information on the methods of this webservice: https://msdn.microsoft.com/de-de/library/office/websvclists.lists_methods.aspx

Hope it helps

Reply