cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bengood
Regular Visitor

Automated Time Reports

I am trying to build a flow that will grab all the hours for a specific employee for a 2 week pay period from the attached spreadsheet, and email them a custom excel sheet with their hours for that pay period. The only ways I can think of doing this are extremely labour intensive and would have to be done for each separate employee. Any suggestions?

Bengood_0-1598531039858.png

 

3 REPLIES 3
Yutao
Microsoft
Microsoft

Hey @Bengood ,

 

One question here, when you send out the report to a specific employee via email, does it have to be an Excel workbook as an attachment to the email? Can it just be a table in the email body?

 

I feel if the above approach is acceptable, it can greatly simplify the problem.

 

Sending an workbook attachment is probably still doable, but might be much more complicated IMO.

 

Yutao

 Thanks for the reply Yutao, a table in the body would work perfectly.

I guess the key steps are:

  1. Get a list of distinct names from the workbook
  2. Loop through the distinct name list:
    1. Get rows by filtering the table with each name and the cutoff date (two weeks back)
    2. Generate HTML table for the rows
    3. Send email to the person with the generated HTML table

 

Specifically, here is how my test flow builds a distinct name list:

flow-get-distinct-names.png

 

Here is the expression used in the above "Build distinct names array" step:

 

intersection(body('Select_to_make_names-only_array'), body('Select_to_make_names-only_array'))

 

 

Then for the loop:

flow-loop-1.pngflow-loop-2.png

 

Hope this helps!

 

Yutao

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,045)