How to create a link to a specific approval request in Power Automate

Do you want to send someone a direct link to an approval request in Power Automate? This can be useful if you want to remind them via chat or email or assign them a task in Planner or To Do. In this blog post, I’ll show you how to get a link to a specific approval request’s link that you can use in different Power Automate flow concepts.

Note

If you’re looking for how to send a link to ALL a user’s pending approvals (rather than a specific approval request), check out my recent post on how to create a link to open the Approvals app in Teams.

You may already know that Power Automate has three approval related actionsStart and wait for an approvalWait for an approval, and Create an approval. Each of these actions has different dynamic content available for later steps. To get a link to a specific approval request, we need to use the Create an approval action because it gives us access to the Respond link dynamic content. This is the link that will take users directly to the approval board in Power Automate with their approval task open awaiting response.

Respond link dynamic content | Click to enlarge

How can you use this link? For example, imagine you want to create a flow that runs when a new request is created in SharePoint and creates a Planner task for the approver with the link to the approval request.

Illustration of the overall concept here – a link to an approval request | Click to enlarge

Here are the steps for this particular request scenario:

How to create a Power Automate flow that assigns Planner tasks containing links to approval requests

Note: For sensitive information, like leave requests, you’ll want to be mindful of PII and privacy and consider email or chat or other ways to use the link so only individuals who should see sensitive content can. This is merely an example of how you might use Planner tasks for any request scenario.

  1. For your flow’s trigger, search for SharePoint and select When an item is created. Configure the trigger by selecting the site and list where you want to monitor new items. For example, you might choose your HR site and the Leave request list.
  2. Click Add an action and search for Create an approval. Configure the approval details as you need. In our example, you might want to request approval from the employee’s manager and set the title to “Leave request approval.” If you intend to send custom notifications via email, planner tasks, etc., click Show advanced options and set Enable notifications to No. This will prevent approvers from receiving multiple notifications about the same approval request.
The first three steps of our approval flow | Click to enlarge
  1. Click Add an action and search for Create a task (Planner). Select the plan and bucket where you want to create the task. For example, you might choose your specific team’s plan and the Pending tasks bucket.
Planner task configuration | Click to enlarge
  1. Click Add an action and search for Update task details (Planner). Select the task ID from the previous Planner action. In the References section, fill in the following fields: References Alias is the text that will be clickable. References Resource will be the Respond link dynamic content from the Approval step. And References Type will be Other.
Update task details configuration | Click to enlarge
  1. Optionally, you can add more actions after creating the approval and updating the task details. For example, you could add a Wait for an approval action to take the outcome of the approval request and perform conditional actions based on it. Or you could add an Update item action (SharePoint) to set the original request’s Approval status from Pending to Approved or Rejected. Or you could add a Send an email action (Outlook) to notify the requestor, copying the approver and HR, with the final outcome of the request.
Optional final steps ideas | Click to enlarge
  1. Save your flow and test it.

That’s it! Now whenever a new request is created in SharePoint, a Planner task will be created for the approver with a direct link to the approval request.

You can apply this technique in other scenarios as well. For example, you could send chat messages or emails with links to approvals using Teams or Outlook actions. Or you could create personal To Do tasks with links using Microsoft To Do actions.

How might you be able to use direct links to specific approval requests in your business processes?

References and further reading

Looking for a deeper dive and more ideas? Look no further.

How to create a PTO/vacation request form and approval process in SharePoint

I was recently asked to develop a PTO request form that accomplished the following:

  • Allowed users to submit PTO, Remote work, Training, and Other requests
  • Auto-lookup of the employee’s manager
  • Send confirmation to submitter
  • Notify manager and seek approval/rejection with comments
  • If approved, send notification with an iCal link users can save to their calendar, and add the PTO to our shared departmental calendar (minus any comments)

Note: This particular build was done on SharePoint Server 2016 and uses a SharePoint Designer workflow.

Create the PTO request form

Thanks to Gregory Zelfond for sharing the idea of using a Tasks web part for this as opposed to a list. Much of this first section is inspired by his post here, with some adjustments for my purposes and preferences.

  1. Add a tasks app and name it PTO Requests

  2. Go to List settings for the new tasks app

  3. Configure Versioning settings as follows



  4. Back under List settings, configure the following Advanced settings as seen here

      


  5. Under Views, keep All Tasks, My Tasks, Approve/reject Items, and Calendar. Delete the rest. Rename All Tasks and My Tasks to All Requests and My Requests.



  6. Back under List Settings, under Columns, create the columns shown in green here, and rename those in red. Duration should be the last column you create (number format), and its formula follows the screenshot. Category needs to be the types of “Out of Office” a person could request (like PTO, Remote, Training, Other).

    Click to enlarge

     

    =IF(AND((WEEKDAY([End Date],2))<(WEEKDAY([Start Date],2)),((WEEKDAY([Start Date],2))-(WEEKDAY([End Date],2)))>1),(((DATEDIF([Start Date],[End Date],"D")+1))-(FLOOR((DATEDIF([Start Date],[End Date],"D")+1)/7,1)*2)-2),(((DATEDIF([Start Date],[End Date],"D")+1))-(FLOOR((DATEDIF([Start Date],[End Date],"D")+1)/7,1)*2)))

    I like the Duration column because it will allow us to show how many weekdays (not including weekends) the PTO Request includes. So those multi-week or broken-week requests show an accurate number for management purposes.

  7. Back under List Settings, select “Task” from under Content Types. Configure each column (hide, make optional or require) as follows:

    Click to enlarge

     

  8. Your new form should resemble this now:
         
    Click to enlarge

     

  9. You might want to spend some time making your views a nice dashboard as well. Here’s what I did for “All Requests.” Notice I grouped by a different calculated column which determines whether the PTO is Upcoming, Current, or Past and then sub-grouped by category.

    Click to enlarge

Create the workflow for approval and calendar addition

In SharePoint Designer, add a new 2010 platform List Workflow for the PTORequests list.

  1. Go to Workflow Settings


  2. Check all “Start Options”


  3. Click “Edit workflow”

Here’s a preview of what we’re going to build:

Click to enlarge

Because this workflow has many steps, I’m only going to show some high-level tips for completing it. Build your workflow to suit your needs. If you have specific questions on how I built mine, please comment.

The approval request email

For the “then Email Current Item: Approver” step, here’s how I did the email:

The link for approving and rejecting is as follows, and you’ll need to replace the red text with a lookup to the current item’s ID. The easiest way to get this might be to do a test submission and copy the link to the approval page where the manager will choose Approved, Rejected, or Pending. You can find this page by viewing a submission, then clicking “Approve/Reject.”

Then just be sure to swap the specific ID with the lookup field for ID.

https://YOURSITE/sites/it/_layouts/15/approve.aspx?List=%7BLISTGUID%7D&ID=[%Current Item:ID%]&Source=%2Fsites%2Fit%2FLists%2FPTO%2520Requests

This will reduce the number of clicks your approvers/managers have to do significantly. Their process will be:

  1. Click big link in email
  2. Select decision and enter comments
  3. Save/Submit

If denied email

No bells and whistles here. You might even include a link to the dash suggesting they submit another request if they wish.

If approved, create calendar item

This is fairly straightforward. If approved, we create an item in a different list. I even edited the “Calendar” view of my PTO requests by adding an “app part” for the separate calendar instead of using the built-in calendar view the task list provides. I then just minimized and hid the chrome of the “Calendar” web part that was already on the view. This allowed me to keep some overlays and other processes related to the second calendar, but see if in context of PTO Requests.

Also, to protect the privacy of those submitting “Other (please explain)” requests (likely FMLA or something private) I have the workflow changing “Other” to just “Out of Office” for the purposes of adding to our shared calendar.

If approved email

Since I created a calendar item if approved, I’m including an iCal link in the approval email for users to open the .ics file and save it to their calendars. Here’s a post on how to structure iCal links. Just instead of creating a calculated column, construct the URL in SharePoint Designer:

Click to enlarge

Improve the look with script (optional)

The following script improves the look of both your views and your forms. It will:

  • Get rid of  “See also” items when viewing requests
  • Change “New task” to “New request” in your views
  • Make sure all fields are visible, and not hidden behind “Show More”

Just copy and save the following script as a separate .js file in your Site Assets and follow the instructions beneath the script to add it to your views and forms. 

<style type="text/css">
/* Show all fields in form */
.ms-formtable tbody {
display: table-row-group !important;
}
.ms-recommendations-panel{display:none !important;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script&gt;
<script>
$(document).ready(function(){
var spans = document.getElementsByTagName("span");
for(var i=0;i<spans.length; i++) {
if(spans[i].innerHTML == "new task") {
spans[i].innerHTML = "new request";
break;
}
}
});
</script>
view raw PTORequests hosted with ❤ by GitHub

Views

  1. Go to a view
  2. Settings –> Edit Page
  3. Insert/Add web part –> Media and Content –> Content Editor Web Part
  4. Add link to script saved on site
  5. Save and repeat for each view

Forms

Go to your list –> List –> Form web parts

Click to enlarge
  1. Select a web part
  2. Settings –> Edit Page
  3. Insert/Add web part –> Media and Content –> Content Editor Web Part
  4. Add link to script saved on site
  5. Save and repeat for each form

Good luck!

Solution: “The user who attempted to complete the task is not the user to whom the task is assigned”

You might run into this issue when running task processes in SharePoint Designer.

“Reason: The user who attempted to complete the task is not the user to whom the task is assigned.”

Assuming the person should actually be able to complete the task, check the following:

  • Make sure the user who was assigned the task does not have multiple accounts. If they do, the task could have been assigned to the account that the person isn’t currently signed in as when attempting to complete the task.
  • If it’s someone completing the task on behalf of another, make sure that individual is either:
    • A Site Owner (site settings, site permissions, people and groups, site owners) or
    • Task process owner (in SPD 2010 workflows, go to the properties for the task step and set task process owner. Click OK and republish workflow.):

Automatically open SharePoint 2013 workflow tasks in Edit mode for easy one-click approvals

one-click approval

On one of my recent projects, a client asked if it would be possible for the link to a task within a workflow notification email to open the task in “edit” mode instead of “display”. If you’re unfamiliar with SharePoint 2013 task processes built in SharePoint Designer, here’s what their process looked like prior to our change:

  1. Someone submits form
  2. Approval request sent to manager
  3. Manager clicks link in email to open task
  4. Manager clicks “Edit”
  5. Manager clicks “Approve”

They wanted to eliminate step 4 to make the process as easy as possible (one-click after opening link in email). Here’s what we ended up doing:

Continue reading “Automatically open SharePoint 2013 workflow tasks in Edit mode for easy one-click approvals”

Microsoft Flow vs SharePoint Designer (SPD) Approvals

WORKFLOWvs

Perhaps one of the most useful automated processes out there is the ability to do approval processes. We fortunately have two tools on-prem or online that allows us to perform this action. Microsoft Flow offers some incredible connectivity between services (like approve a Tweet and post it, approve something from Google Docs and have it moved to SharePoint, etc.), but the approval process itself is very simple at this point and doesn’t offer some of the more robust features and customization options we get in SharePoint Designer 2013 approval processes.

I also will use both tools in the same business process occasionally, because they both have unique strengths.

But which do you use for approvals?

The quick answer to the question is: Use Flow for simple approvals, or approvals that involve multiple sites or external services. Use SPD for more complicated processes and customization options for approvals that involve a single site.

Continue reading “Microsoft Flow vs SharePoint Designer (SPD) Approvals”

Microsoft Flow approval of Twitter tweet and Facebook post submissions via SharePoint list

This tutorial works for any Microsoft-Flow connected social media platform, but we’ll specifically go through the steps for setting up a Twitter tweet and Facebook post submission system. We’ll be utilizing Microsoft Flow’s new “Approval” feature. Here’s our (and maybe your) scenario.

  • We want to allow broader participation in social media content, while still maintaining a close grip on the quality and management of our platforms. This is more inclusive, increasing engagement and also giving you more eyes and ears throughout the organization while maintaining control
  • Individuals will submit their ideas (can be via direct email to a list, a form, PowerApp, etc. – we’ll use a list)
  • Social media manager or team will approve or reject submissions which will then be automatically posted to the applicable social media network if approved. See bottom of post for additional challenges to enhance this system.

Let’s get started!

Continue reading “Microsoft Flow approval of Twitter tweet and Facebook post submissions via SharePoint list”