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 Apps - Building Power Apps
Suggested answer

Creating an appointment using a powerapp

(0) ShareShare
ReportReport
Posted on by 206
Hello,
I have a powerapp that creates a reminder for our admin team to carry out a process when a driver leaves our fleet.  At the moment it works as it should, the user presses a button within the powerapp and amongst other things it books a reminder into the users Outlook for 7 days time.  Our process has changed slightly and I need to update the powerapp to reflect this change though i have no idea how to do this.

If a driver leaves at any point in any month there needs to be a reminder set into the users Outlook calendar for the 8th of the following month - any ideas how I will do this ?.  Below is the part of the code that works at the minute and i'm hoping someone can tell me how to edit it to perform the new appointment settings.

Thanks for your help in advance.
 
//Book reminder in for driver deletion
 
Office365Outlook.V3CalendarPostItem(LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,"DELETE DRIVER FROM THE SYSTEM",  
 
DateAdd(Now(), 7 + TimeZoneOffset(),TimeUnit.Days),
 
DateAdd(Now(),7 + TimeZoneOffset(),TimeUnit.Days),
 
   { Importance:"High",
    IsAllDay: false,
    RequiredAttendees:"nichole.bates@stationtaxis.com; michael.grogan@stationtaxis.com",
    Body:"Reminder to delete this driver from the system 7 days after leaving "& Upper(FstName.Text) & " , " & Upper('2ndName'.Text) & " , " & "Badge Number:" & Badge2.Text & " " & BadgeDrvr.Text,
    IsHtml:true});
I have the same question (0)
  • Jiis Profile Picture
    254 Moderator on at
    Creating an appointment using a powerapp
    Do you need the reminder to be 8. date in the next month or does it need to be the next 8. date no matter if its this month or the next?
  • Suggested answer
    Jiis Profile Picture
    254 Moderator on at
    Creating an appointment using a powerapp
    Okay if it needs to be the next month 8. date
    Set(NextMonthFirstDay, DateAdd(Today(), 1, TimeUnit.Months) - Day(Today()) + 1);
    
    Set(ReminderDate, DateAdd(NextMonthFirstDay, 7, TimeUnit.Days));
    
    Office365Outlook.V3CalendarPostItem(
        LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,
        "DELETE DRIVER FROM THE SYSTEM",  
        ReminderDate,
        ReminderDate,
        {
            Importance: "High",
            IsAllDay: false,
            RequiredAttendees: "nichole.bates@stationtaxis.com; michael.grogan@stationtaxis.com",
            Body: "Reminder to delete this driver from the system on the 8th of the following month: " & Upper(FstName.Text) & " , " & Upper('2ndName'.Text) & " , Badge Number:" & Badge2.Text & " " & BadgeDrvr.Text,
            IsHtml: true
        }
    );
    
    if it needs to be the next 8.date.
     
    Set(CurrentDate, Today());
    
    Set(CurrentMonth8th, DateValue(Text(Year(CurrentDate)) & "-" & Text(Month(CurrentDate), "00") & "-08"));
    
    If(
        CurrentDate <= CurrentMonth8th, 
        Set(ReminderDate, CurrentMonth8th), 
        Set(ReminderDate, DateAdd(CurrentMonth8th, 1, TimeUnit.Months)) 
    );
    
    Office365Outlook.V3CalendarPostItem(
        LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,
        "DELETE DRIVER FROM THE SYSTEM",  
        ReminderDate,
        ReminderDate,
        {
            Importance: "High",
            IsAllDay: false,
            RequiredAttendees: "nichole.bates@stationtaxis.com; michael.grogan@stationtaxis.com",
            Body: "Reminder to delete this driver from the system on the 8th: " & Upper(FstName.Text) & " , " & Upper('2ndName'.Text) & " , Badge Number:" & Badge2.Text & " " & BadgeDrvr.Text,
            IsHtml: true
        }
    );
     
  • Suggested answer
    abc 123 Profile Picture
    784 Moderator on at
    Creating an appointment using a powerapp
    The hardest part is figuring out when the next 8th is. It could look something like this:
    UpdateContext({dtmToday: Today()});
    UpdateContext({intMonth: Month(dtmToday)});
    UpdateContext({intYearNext: Year(dtmToday)});
     
    If(Day(dtmToday)<=8,
        //Use current month & year
        UpdateContext({intMonthNext: intMonth});
        UpdateContext({intYearNext: Year(dtmToday)});
        ,
        //Need to determine the next 8th.
       
        //Based on current Month, set next month and year
        If(intMonth < 12,
            UpdateContext({intMonthNext: intMonth + 1});
            ,
            UpdateContext({intMonthNext: 1}),
            UpdateContext({intYearNext: intYearNext+1})
        );
     
    );
     
    UpdateContext({dtmNextEight: intYearNext & "-" & intMonthNext & "-08"})
     
    Then, you can graft that into the same structure that you used previously to Post an appointment:
     
    Office365Outlook.V3CalendarPostItem(LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,"DO SOMETHING ON THE 8th",  
    dtmNextEighth,
    dtmNextEighth, 
       { Importance:"High",
        IsAllDay: false,
        RequiredAttendees:"nichole.bates@stationtaxis.com; michael.grogan@stationtaxis.com",
        Body:"Reminder to do something on the 8th "& Upper(FstName.Text) & " , " & Upper('2ndName'.Text) & " , " & "Badge Number:" & Badge2.Text & " " & BadgeDrvr.Text,
        IsHtml:true});

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 624 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 384 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 246

Last 30 days Overall leaderboard