cancel
Showing results for 
Search instead for 
Did you mean: 

Timesheet check for Project Service Automation (PSA - Microsoft Dynamics 365)

Losing a lot of time by checking everyone's timesheet if the work week has been completely registered in the PSA timesheet portal. In Belgium, most of the employees have 40 hours working week. In this MS Flow, a check will be performed every Friday evening around 8 PM. 
msflow08 - step 01.1 - 2.pngSet time schedulemsflow08 - step 01.1.png
Defining some variables that later will be used during the calculation of the timesheet total hours and to send a notification to the employees.

msflow08 - var.pngVariables

In the example, the work week is starting on Monday at 8.30 AM and end on Friday at 5 PM. To define the date on Friday, "Date Time" - actions will be used to get the current date and time. This will reflect the date on this Friday that the Flow is running.

msflow08 - step 02.1 - 2.pngDate Time - Actionmsflow08 - step 02.1.png

Getting the date and Time before Monday morning, so that when filtering the time registration of the complete week will be selected.

msflow08 - step 03.1.pngSet Begin date and Time

To get all the employees that need to be checked, the "comma Data Service"- connector/action will be used.
The action "List records" will be used the get all the record of each employee.

msflow08 - step 04.1.pngPSA Users - getting employee records

After collecting the first information, check of the timesheet for an employee can be started. Process 05 - Check timesheet employee" will handle the work. Six steps in the "apply to each" will calculate the total hours in registered for an employee and sent a notification when needed. Let's look deeper into the process.

msflow08 - step 05.pngProcess calculate registered work hours and notification as needed.

The first step of the process is getting the Employee Name (Because in PSA the employee/user is a unique number). The name of the employee can be found in the entity "PSA Users", under the field "psa_name".
This value will be set into the variable "EmployeeName". msflow08 - step 05-1.pngSet variable EmployeeName
The second and third step will get the employee e-mail address and this can be found in the entity "Users". This entity contains detailed employee/user information.

msflow08 - step 05-2-3.png

The output value will contain the Primary E-mail address of the employee/user (field "internal email address" in the entity Users), this value will be set to the variable "EmployeeEmail". The fourth step in the process will be filtering the weekly registered hours out the entity "Hours". 
msflow08 - step 05-4.pngFiltering registered hours

The fifth step of the process will be calculating the total amount of registered hours in the week.

msflow08 - step 05-5.pngCalculate Total Hours

Getting the hours will result in output as a string (example 1.5). This need to be converted to a floated integer value, before adding to the number variable that has been defined upfront, see screenshots below.

msflow08 - var - detail1.png

 

The calculation in detail:

msflow08 - step 05 detqils.pngProcess calculation details

In the last two steps, the total amount of hours will be check if there is a minimum of 40 hours registered, when not email notification will be sent to the employee/user to review his weekly time registration. The total hours variable will be reset to zero for the next check for another employee/user.

msflow08 - step 05-6-7.png

Total overview of the Flow, see below.

msflow08 - total.png

When questions or remarks please feel free to contact me.

Thanks for reading!

Meet Our Blog Authors
  • Working daily with Microsoft Cloud to deliver the needs of my company, my customers and various Microsoft communities and forums. | Office 365 | Flow | PowerShell | PowerApps | SharePoint |
  • Co-founder of https://plumsail.com, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • Solution Architect with Slalom, and organizer of the Boston Office 365 User Group, and long term SharePoint/Office 365 veteren. Find more at http://www.davidlozzi.com. Follow @DavidLozzi
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc ( https://triad.co.uk)
>