Couldn't find anything through research, but wanted to know if there's an action in Nintex workflow that will activate/deactivate a site or site collection feature for a site during site creation in a workflow?
For example: Create a Site with a specific template. Then activate publishing.
Solved! Go to Solution.
Sorry, you wont be able to enable features from a workflow. I looked into possibly using webservices, but I didn't see a method for manipulating features, just to see which are activated.
It is a best practice to enable the publishing feature after site creation and not use a saved site template with publishing already enabled (yes, this is possible to do).
You could create a task for the admin to enable these features from the workflow though. Then after they do, they complete their task and the workflow can then complete any outstanding provisioning activities. Like creating lists.
I have actually successfully activated the Publishing feature on a site using the SP.FeatureCollection.add Method.
Here's some info:
Reference this super helpful post for instructions for getting the request digest and for making a rest api call in a web request action:
Your web request configuration would look something similar to this:
URL: [site url variable]/_api/web/features/add('94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb') *You'll need the guid of the feature you are trying to activate
Content type: application/json;odata=verbose
Value: [digest variable] *see instructions in the post referenced above
Leave the big text field blank as you don't need to pass any parameters.
You are correct Andrea! I was shown this in another discussion and forgot about this one long ago. Thank you for updating!
Followed your steps above and getting the following error:
Request failed with status: FORBIDDEN.
Any suggestions what might be causing this ?