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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Cancel Time Off Request
Power Apps
Unanswered

Cancel Time Off Request

(0) ShareShare
ReportReport
Posted on by 221

We have an app that employees can request time off, after submitting it goes through an approval/denial flow process, then inserts time off into the Outlook calendar.  There are not many cancellations, but we need to give the employees the ability to request to cancel their time off.  I created the calendar below in our app with an "X" next to the employees time off.  This then opens up window asking them to confirm this request. 

 

Can someone offer a suggestion or code to include in the "OnSelect" that would send an email to a supervisor with the employees name, dates/times that the employee wants to cancel?

 

Thank you!

Shaguar357_0-1717168323487.png

 

Shaguar357_2-1717168487180.png

 

Shaguar357_1-1717168395775.png

 

Categories:
  • subsguts Profile Picture
    1,259 Moderator on at
    Here's a snippet of code that can get you started can add to your OnSelect that will send an email to the employee's manager.  You'll have to customize it to send whatever data you want in the email body.  
     
    Note: Make sure you add the Office365Outlook connector first.
     
    Also, I suggest reviewing the structure of the SendEmailV2 function.  The code below is not a cut & paste and it will work, you need to fill in the blanks as I don't know what the names of your fields are, etc.
     
    However, this should allow you to get what you want done as the primary thing you need to do is just used the SendEmailV2 function.  
     
    //Send email to the team member's assigned leader
    Office365Outlook.SendEmailV2(
            Office365Users.ManagerV2(<email of the team member>).mail,
        "Subject",
        "Employee " & varEmployeeName & " wants to cancel his requested time off, which started on " & varStartDate & " and ends on " & varEndDate...... 
    );
     
    Final Note:  I suggest using html for the body so you can change the font, bold things, etc. (basically make a pretty email ;-)).
     
    If this helps, please kudo, and if this solves your problem please mark this as a solution.  Thank you.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard