Tuesday, March 22, 2016

SharePoint 2013: How to implement task form hyperlinks in Approval workflow email notification

Introduction

The SharePoint 2010 Approval workflow is one of the standard workflows that comes with SharePoint 2010 and 2013.  The task notification that it sends to approvers presents buttons that provide approvers with one-click access to the task's Edit and View forms.  These buttons are not visible if the approver accesses his or her email via web browser.  Instead, this one-click access must be provided by hyperlinks.  This procedure shows you how.

Solution

  1. Launch SharePoint Designer 2013.
  2. Navigate to the site containing the target document library.
  3. In the Navigation pane, at left, select the Workflows item.
  4. Under Globally Reusable Workflow, click on Approval - SharePoint 2010.  
    A popup will appear enabling you to create a copy.
  5. Click Yes. A dialog will appear.
  6. Enter a name for the workflow, and description, and then click OK.  The results pane updates to display another tab.  On this tab, you will see a single stage.
  7. Click on Approval Workflow Task (en-US) Copy 1.  The tab updates to display the workflow customization page of the copied workflow.
  8. In the Customization section, click Change the behavior of a single task.  The tab updates to display the copied workflow that you can now edit.  
    There are four email notification actions in this workflow.  You only need to modify the ones in the When a Task is Pending stage.
  9. Click on Current Task:Assigned To. A dialog appears displaying the email format.
    It's the last line that will be modified here.
  10. Replace task item 3 with
    Open this Task to accept or reject the approval, or View the status of this task for more actions (if you cannot update this task, you may not have access to it).
  11. Select Task, and then click the hyperlink symbol at upper right . This opens the Edit Hyperlink dialog.
  12. For the Address, click the Function button . This opens the Lookup for String dialog.
  13. From the Data source dropdown, select Current Task: Approval Workflow Task (en-US).
  14. Then from the Field from source dropdown, select Form_URN.
  15. Click OK, and then click OK again. The Task word in the email is now a hyperlink to the task's edit form.
  16. Next, select the View word in the email, and then click the hyperlink symbol.  The Edit Hyperlink dialog appears.
  17. For the Address, click the Function button.
  18. From the Data source dropdown, select Workflow Context
  19. From the Field from source dropdown, select Workflow Status URL.
  20. Click OK, and then click OK again.  The email content will now look like this
  21. Click OK.  The Define Email Message dialog closes.
  22. Now, repeat these steps for the Workflow Context: Initiator email notification, and you are done.
  23. Save and Publish.  You are done.  Now you can add this workflow as you would any of the other 2010 globally re-usable workflows.  
  24. One important note: the workflow you created (from a OOTB workflow) is only available within the scope of the web or site you created it in.  This means that if you connected SharePoint Designer to a particular web within a site collection, the workflow will only be available within that web.  If you want it to be available to all webs within a site collection, you must create it in the root web of the site collection..

References

No comments: