web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power automate flow fo...
Power Automate
Unanswered

Power automate flow for attendance tracking and Send an reminder on teams

(0) ShareShare
ReportReport
Posted on by 10

I am attempting to create a Power Automate cloud flow that will send a reminder on Teams if an employee fails to update their attendance on an Excel Online sheet. The sheet contains a sample dataset that includes columns for Name, Email, Employee ID, and daily attendance for each day of the month, Below is the sample data for reference

 

NameEmailEmp Id1-Mar2-Mar3-Mar4-Mar5-Mar6-Mar7-Mar8-Mar9-Mar10-Mar11-Mar12-Mar13-Mar14-Mar15-Mar16-Mar17-Mar18-Mar19-Mar20-Mar21-Mar22-Mar23-Mar24-Mar25-Mar26-Mar27-Mar28-Mar29-Mar30-Mar31-Mar
ABCABC@abc.com12345678PWOWOPPPPPWOWOPPPPPWOWOPPP  WOWO     WOWO
XYZXYZ@abc.com87654432PWOWOPPPPPWOWOPPPPPWOWOPPP  WOWO     WOWO

 

The flow should scan the table and identify any date columns where attendance has not been marked and add the name of the employee to an array. The flow should then post a message in a Teams channel or group that includes the names of all employees who missed marking their attendance.

 

Your support would be appreciated...Thank You!

 

Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,690 Moderator on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    Do you want to send this daily? Weekly? Monthly?

  • MaverickNK Profile Picture
    10 on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    Daily, End of the Day

  • Rhiassuring Profile Picture
    8,690 Moderator on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    @Chriddle  @Expiscornovus @Pstork1 

    Hey friends, I was trying to figure this one out and I got stuck on trying to Filter an Array on a variable. The steps for the most part seem easy and then I came to a grinding halt after spending 3 hours trying to figure that one piece out...... 

    Need to filter the array by utcNow('dd-MMM') -- I've tried putting it in a compose, wrapping it in a string, putting it in a variable, changing it to an item()?with the output at the end... 

    How do we trick PA into taking a column name that is a variable???

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    I don't think you'll be able to specify the column name directly as the result of a formula.  What I would do instead is build a tiered set of Switch statements based on the result of utcNow('MMM') and utcNow('dd'). So first you would have 12 cases to switch based on the month and then 28 to 31 cases for each month (use default to get more than 26). Eventually you'll make it to a hard coded filter array. Store the results in an array variable and use the array for the rest of the processing.  There may be a more elegant solution, perhaps using a child flow, but I'm not sure what it would be.

  • Rhiassuring Profile Picture
    8,690 Moderator on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    Oh wow, okay. Well, I feel better that I'm not alone in internally-screaming at this requirement that should be easy (haha, "should be easy", I sound like a new poster 🙂 ) but ... isn't. 

    OP, I am going to keep thinking on this for you. Even for a workaround.

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    I have a sample flow that can send reminders for attendance. 

     

    1. Firstly, set up the recurrence flow that runs daily. Set the time zone and start time accordingly:

    ManishSolanki_0-1711942813299.png

     

    2. Initialize an array variable 'defaulterList' that holds the list of users & dates for which attendance is not marked:

    ManishSolanki_1-1711942848408.png

     

    3. Add "List rows present in a table" action to fetch records from the excel sheet:

    ManishSolanki_2-1711942927799.png

     

    4. Add "Select" action to get all the dates of the correct month starting from 1st to current date in an array. We need to use expression to get the array of dates. Expression needs to be added in the expression box as shown below:

    ManishSolanki_4-1711943203535.png

    range(1,int(utcNow('dd')))

    Similar, add the below expression in key parameter of Map & leave the value textbox blank:

    concat(item(),'-',utcNow('MMM'))

     

    5. Add another "Select" action to create an array of name of the columns which we would be comparing in the source excel file. This is done to avoid getting reminder for future dates:

    ManishSolanki_5-1711943470748.png
    Expression used in 'From' parameter:
    xpath(xml(json(concat('{"root":{"items":',body('Select'),'}}'))),'//items')

    Click on "Switch Map to text mode" link button on the right side of map parameter and enter the below expression in the Map textbox:

    xpath(item(),'name(/items/*)')

     

    6. Add "Apply to each" action and pass value object from the output of list rows present in a table action. We will iterate each record of the user and check for empty entries till the current date:

    ManishSolanki_7-1711943781906.png

    Inside loop, add "Select" action which will return the missing entries for a user:

    ManishSolanki_8-1711943860030.png

    Expression used for 'From' parameter:

    xpath(xml(json(concat('{"items":',createArray(item()),'}'))),concat('/items/*[contains(','''',join(body('Select_2'),','),'''',',local-name()) and .='''']'))

    Expression used for 'Map' parameter. Please click on 'Switch Map to text mode' link bottom before entering the below expression:

    replace(replace(xpath(item(),'name(/*)'),'_x003',''),'_','')

    Add "Condition" action to compare if previous select action returns missing attendance entries. If yes, then we will store the username & date in an array variable:

    ManishSolanki_9-1711944057157.png
    length(body('Select_3'))

    In "Yes" block, add "Append to array variable" to store the name of the user & the date for which attendance is not marked:

    ManishSolanki_10-1711944194690.png

     

    {
    "Name": @{items('Apply_to_each')?['Name']},
    "Day(s)": @{join(body('Select_3'),', ')}
    }

    Pls copy & paste the above code in the action.

     

    7. Finally, add a condition action to check if we have an element in the array variable for sending reminder. 

    ManishSolanki_11-1711944349305.png
    length(variables('defaulterList'))

    In "Yes" block, add "Create HTML table" action to create a table from an array:

    ManishSolanki_12-1711944454227.png

    Finally, add "Post message in a chat or channel" action to post the reminder on the channel message:

    ManishSolanki_13-1711944603362.png

     

     

    Output:

    ManishSolanki_14-1711944732952.png

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    The reason it isn't easy is because this kind of feature opens the system up for Code Injection hacks.  Most systems nowadays don't allow the injection of dynamic code.  Its just too much of a security risk.

  • MaverickNK Profile Picture
    10 on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    Thank You @ManishSolanki for your invaluable help and the learning that came with it...

  • MaverickNK Profile Picture
    10 on at
    Re: Power automate flow for attendance tracking and Send an reminder on teams

    Thank You @Rhiassuring for the time that you spent helping me with this query...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard