cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerGell54
Level: Powered On

Overtime Entries Multiple Users Flow

Hi,

 

I have an idea to automate our company overtime forms. Id like to use PowerApps for data entry and use a SharePoint List to hold the data, the list will consist of standard strings such as name, manager, time spent, internal reference etc.

I'd like to build a Flow to run at 8am in the morning and get all the data and submit to each manager for approval, the catch is, users may submit multiple list items as they may get called out at different times during the night and submit different items.
With a list with multiple users and possible multiple entries for one user, how would i build a Flow to gather all the items for one user and present them in an email to their manager?

 

If there is a better way to attack this let me know!

 

Hope it makes sense, let me know if you need to know anything else.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Overtime Entries Multiple Users Flow

19 REPLIES 19
PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

Anyone?

Re: Overtime Entries Multiple Users Flow

Okay, here is what I have.  I create a list of users, this would be the list of employees that you want get the hours for.  There are other ways to get the list of users but this is just one way that I have used in the past.  Then we loop and get the hours for each users. Next we build a table for all the entries for that user and add that table in a email or approval.

TimeSheet1.jpg

 

 

 

TimeSheet2.jpg\

TimeSheet3.jpg

 

TimeSheet4.jpgIf this has helped please mark as a solution.

 

 

Super User
Super User

Re: Overtime Entries Multiple Users Flow

I’d either do it the same way @spsolutionsgrp solved it... or put an OrderBy User into the SharePoint Get Items action.

Then use a Do Until loop to keep track of the current users items, building a table and just keep looping through until the User changes. Then send the email and carry on for the new user.

- Mark
Community Support Team
Community Support Team

Re: Overtime Entries Multiple Users Flow

Hi @PowerGell54,

 

Could your problem solved by @spsolutionsgrp's solution, if yes, please consider Accept it as the solution to help the other members find it more quickly, if no, please share more details about your sharepoint list and I would provide a proper workaround for you.

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

This is fantastic, thank you, I've copied this and working great!

 

However, I'm having issues with the send email part as the user's have different managers.

I've added a column with the manager's emails but I'm having difficulty making it dynamic for each created HTML table.

 

Any ideas on this?

 

Sharepoint.PNG

 

I've gathered all the info for each user in "Title" into 1 HTML table, but sending it via email to the "Manager Email" only once is proving challenging.

 

Thank you

Re: Overtime Entries Multiple Users Flow

You want to add the manager to the users list or if the managers are filled out in user profile you could look up the manager.

Re: Overtime Entries Multiple Users Flow

Here are the two options.  Either add the manager to your list of users or if you have the manager field filled out in Active Directory you could use the action to get manager.

 

ListofUsers2.jpgManager.jpg

PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

Thank you, i've applied this but it is still sending the gathered HTML multiple times for each user:

 

(in reference to my pic above)

3 of the same HTML email to Daniel Gell's manager
4 of the same HTML email to Service Desk's manager

 

Id just like 1 email per gathered HTML to their Manager

 

Thank you again, i apprieciate this!

PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

Im wondering if its the placement of the Send Email action in the outer loop? 


If there are 7 values on the 1st Apply to Each it will send 7 emails no matter what.

 

I've seen the Do Until method on these forums before and tried it but it was doing the same thing.

 

 

Re: Overtime Entries Multiple Users Flow

The first apply to each should be going through the list of users.  In that list there should not be duplicate users so one emails should be sent for each users manager.

 

Here is my user list.

list1.jpg

 

Here is my time list.

 

PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

Thank you but unfortunately there has to be duplicate users in my list 😞

Re: Overtime Entries Multiple Users Flow

I think you may have the wrong value in the email field.  Make sure it is a value from the first get items list (user list).  Here is a video that may help.

 

https://spheroes-my.sharepoint.com/:v:/g/personal/tmccleary_spsolutionsgrp_com/ESeVI6wPza1Oio_OiMWPp...

 

Re: Overtime Entries Multiple Users Flow

not in the user list.  The user list is just a list of your employees and their manager and is users to build a filter.  If the users list does not work for your solution there may be other options.

Re: Overtime Entries Multiple Users Flow

Here is a solution without the second user table.   This version uses a varible to track what users we have already sent the email for.   

 

TimeEntryv2.jpg

PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

This is great thank you! Could you send me a higher resolution image as im unable to see it please?


 

 

Re: Overtime Entries Multiple Users Flow

Re: Overtime Entries Multiple Users Flow

PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

Gonna give this a whirl now, will let you know how i get on!

PowerGell54
Level: Powered On

Re: Overtime Entries Multiple Users Flow

It works, thank you so much for this!

 

Accepted as Solution!

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,588)