cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Changing Site URL and Title via Nintex Workflow

Jump to solution

We have a top level site with a list that contains information (site name, owner, URL, etc.) about subsites that have been created.  The scenario I’m trying to figure out is how to change a subsite’s URL and Title if a user changes the name of the subsite in the list at the top level.  I’m basically trying to use a workflow to accomplish changing the subsite URL and Title name.

I was able to do this on premise using the PowerShell action for Nintex Workflow that Aaron Labiosa created (NTX PowerShell Action - Stable Release).  But I’m striking out so far as to how to do this in O365 via Nintex Workflow.  Any ideas if this is even possible and if there are any approaches?

Labels: (1)
Reply
16 Replies
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

Eric, this should be possible, using the Call HTTP Web Service Action.  (Don't have time to go into outline it out), but you'll have to come up with a method of know what the current Site Title / URL are and the new Site Title / URL are to be at the top level list.  That way you can send a HTTP POST to the current site url web api to replace the Title and URL.

Will also need to make sure that your workflow has admin workflow permissions to do this.

I do this exact same mechanism (not with subsites but with document sets in a subsite) where the master data is controlled at a top level list.

Reply
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

Maybe Caroline Jung​ could help ? It seems to me she knows how to do this....

Reply
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

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.

Reply
Highlighted
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

Caroline, can you post a link to your blog? I searched around but was unable to find it. Thanks!

0 Kudos
Reply
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution
Reply
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

Thank you Caroline.  Your guidance helped me figure this out.

0 Kudos
Reply
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

Great ! I'm glad that I could help

0 Kudos
Reply
Workflow Hero

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

Caroline Jung‌ I really appreciate you taking the time to provide a workaround for this wf variable bug in web-request actions, that saved me quite some time!!

Frank Fieldwhat's the best way to inquire about a timeline for a fix on this one? I'm working with a single variable in my web-request body, and this bug cost me 5 actions since the below isn't possible. That's quite painful when trying to development within the action count limitations of O365 (especially with more variables or header values like Caroline Jung's example).

Thanks!

Reply
Not applicable

Re: Changing Site URL and Title via Nintex Workflow

Jump to solution

Hi, Patrick Abel‌! Nintex doesn't release roadmap information (and I don't have it anyway). However, if we're talking bug fixes, let's see if   has some information...

Reply