Run SPD2010 workflows with impersonated permission
Today one of my users reported that “something is not happening as supposed to” on a site, which most IT professional would say is quite a typical call we receive…
After a quick test I realised that a workflow meant to start on item submission of an InfoPath form was failing to complete and the workflow status would show “CANCELLED” (very misleading as nobody actually “cancel” that workflow… and this message “The workflow could not update the item, possibly because one or more columns for the item require a different type of information.”
Basically the user’s permissions had changed on the site so that he could not anymore update items in the library but the site owner didn’t realise the knock-on effect this would have on existing workflows as well, especially if the workflow is meant to go search for other items in the library and update them. The user not authorised to edit them will fail the workflow.
A short Google on “SharePoint Designer workflow elevated permissions” and I was reminded by this blog articlehttp://is.gd/RdjmWH about impersonation in SPD 2010 Workflows (and not elevated as mentioned) which was new from SPD 2007.
But not any kind of permission, since it will the logged in user on SharePoint Designer so bear that in mind when releasing to Production environment.
Make sure you are logged in SharePoint Designer with the correct user (one that will not disappear once you finish your development) [note: use the little “change user” icon on the bottom left corner of SPD2010 to switch user].
– Edit your workflow
– Within the steps of the workflow that require to be impersonated with your user insert an “Impersonation Step” by just typing the label
– Move all required steps into it (using Move Up or Down)
– Publish your workflow
– Test with the access level of your user
Et voila !
Note: This short blog article is my first attempt to participate to my colleague Giles‘ blog https://ghamson.wordpress.com as an author and therefore you may also see it on my other blog.