cancel
Showing results for 
Search instead for 
Did you mean: 
pwapp_explorer

Tracking your Flow in your SharePoint list

Very often we will trigger a flow from a SharePoint list, and we need to keep track of where the flow is for the particular list item.

 

This article is going to explain how to keep track of your flows, from inside your SharePoint list.

 

To illustrate this, we going to create a small example - we will create a list, and from the list we will trigger a flow.

 

In the flow, we will send an approval task to a user to approve. This way we demonstrate the following:

  1. Keep track of the state of the workflow;
  2. Keep track of the outcome of the tasks in the workflow.

What do we need to track

We would like to track the following:

  1. Status of the workflow - this is what state the workflow is in;
  2. Results of tasks - so we need to capture:
    1. Who completed the task;
    2. Date/Time the task was completed;
    3. Outcome of the task (approve, reject etc);
    4. Comments;
    5. Any other fields captured in the card.

Example

Start by creating a new list
NewList.pngSelect "List" from the "New" menu

From our list, we should create a flow
NewFlow.pngSelect "Create a flow" from the Flow menu

Choose the template "When a new item is added in SharePoint, complete a custom action"
customaction.PNGChoose this flow template

We now will add the "Start an Approval" task into our flow:
startapproval.PNGChoose Start an Approval action

Add the details of the approval task:
newapprove.PNGManagers Approval

Save this workflow - now we have created our list, and created a workflow that triggers an approval action.

But our list is not connected to our flow at all, so how do we do this?

 

Extending the List

We have to add a set of fields to our list, to keep track of what is happening in our flow.

Add a Status Column

First we add a new column, a Status field to our list. So start by adding a Choice field to the list:

Choice.pngAdd a column, choose Choice

Call it "Status", and our 2 states are:

  • Managers Approval
  • Completed

statuscolumn.PNGAdd Status field

This will hold the current state of the workflow.

Keep track of the task

 To keep track of the task, we should add the following fields:

  • Approver - user who completed the task;
  • Approved Date - Date/time the task was completed;
  • Decision - the decision made;
  • Comment - the comment left by the user.

So let add the 4 fields:

addFields.PNGTask fields

Now we have all the fields to keep track of the status of the workflow, and the result of task.

 

Lets wire up the workflow

The only item left to do, is to get our flow to update our list. So let return to our flow, and add the an "SharePoint -Update item" action after the trigger:

addupdate.pngAdd Update Item action

Set the Status Value to "Managers Approval", as this is the next item in our workflow that is going to happen:

setmanagerapproval.pngSet the Status to "Managers Approval"

Now we will record the details of the approval task in the list, so add another "SharePoint - Update item" action after the approval task. 

Then set the Status to "Completed", and the Approver Claims, Approved Date, Decision, and Comments from the properties of the "Manager Approval" action:

completetask.pngUpdate the list with the results of the Approval Task

Our SharePoint list and workflow are now connected, and we can see the status of the workflow from the list.

wf.PNGCompleted workflow 

Lets test

Now comes the fun part - add an item into our list:

testitem.PNGAdd an item

The Status column should update, showing that the "Manager Approval" task is in action:

in action.PNGStatus column updates

 In our inbox, or flow app, you will receive the task:

task.pngTask from Flow

Complete the task, by approving it, and enter a comment:

taskcomplete.PNGApprove the task, and enter a comment

Check your list, and you will see the Status is "Completed", and the approver, date, decision and comment is updated in the list:

complete.png

A good hint is to add view to list for the different status, so it is easy to keep track of where the workflow are for all list items.

About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: https://ganeshsanapblogs.wordpress.com/about MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: https://linkedin.com/in/manueltgomes and twitter http://twitter.com/manueltgomes. I also write at https://www.manueltgomes.com, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/