Exactly Thomas
.
You can do this using SharePoint REST API (How to execute a SP2013 REST API request with Nintex Workflow).
Here's Microsoft's documentation regarding changing a site properties :
Webs REST API reference
To use this method you need the current subsite url.
You need to first get the request digest (I described how to do this in my blog) and then you can perform a POST web request with the following url :
the following headers :
- Content type : application/json; odata=verbose
- X-RequestDigest : the reference to the variable where you've stored the request digest that you've retrieved
- X-HTTP-Method : MERGE
and the following body (choose content) :
- { '__metadata': { 'type': 'SP.Web' }, 'Title': 'New subsite title','ServerRelativeUrl':'/sites/testsite/new-subsite-url' }
and you need to populate a username and password.
Note that there's a bug if you add references to workflow variables in the body of the web request. The workaround that I've found is to create a collection variable and add the following items Inside this collection (using several Add item to collection actions) :
- { '__metadata': { 'type': 'SP.Web' }, 'Title': '
- the reference to the workflow variable containing the new site title
- ','ServerRelativeUrl':'
- the reference to the workflow variable containing the new site url
- ' }
Then you can use the Join Items in Collection action to get all this content in a workflow variable (and reference this workflow variable in the body/content part of the web request).
Don't hesitate if you need help.