Skip to main content

Notifications

Community site session details

Community site session details

Session Id : nZxlTIRUGHIdHbMeoeUsJ3
Power Automate - Building Flows
Unanswered

Adding a calendar event 6 months from listed date

Like (1) ShareShare
ReportReport
Posted on 23 Jul 2024 03:39:07 by 20
Hi there, 

I have a few questions. 

I have a list in Sharepoint that staff add to whenever they perform a check - they will add the date, who did it, and any notes. 

Because this check should be done every 6 months, I want to create a flow that, once someone has added to the list, the flow is triggered and will create an event in the group calendar 6 months from the date listed.....is this possible? If so, how can I do this? 
Also, when you create a Sharepoint site, it creates a group - this group has a calendar which I open and access in my personal calendar - it is not a Calendar in Sharepoint. I want the event to be added to this group calendar, but when I tried adding a calendar in the flow (just as a practice) I could only see the calendars in my personal calendar - not the group ones. Is it also possible to add an event to a group calendar and how? 

Thanks

I have attached a screenshot of what my calendar looks like in https://outlook.office.com/calendar
  • Expiscornovus Profile Picture
    31,643 Most Valuable Professional on 25 Jul 2024 at 19:45:57
    Adding a calendar event 6 months from listed date
    Can you remove the last () after your Date checked field?
     
    Try this instead:
    addDays(triggerBody()?['DateChecked_x0028_mm_x002f_yy_x0'],190,'MM/dd/yyyy')
     
    @NsL Coder, good suggestion to use addToTime function. I forgot about that function :)
     
  • nels99 Profile Picture
    20 on 25 Jul 2024 at 04:17:01
    Adding a calendar event 6 months from listed date
    In Dynamic content, it allows me to addDays and then select the specific title from the list (eg, Date Checked (mm/dd/yyyy) - you can see in the image below how the relevant title is highlighted blue to select it for the string. 
     
    Once I have selected this, I can then continue with the string which shows as: 
    addDays(triggerBody()?['DateChecked_x0028_mm_x002f_yy_x0'](),190,'MM/dd/yyyy')
     
    However, when I go to click add, it comes up with this: 
     
    When I try to do this in the Function, I can't see an option to select the 'Date Checked (mm/dd/yyyy)' option, and I do not know how to create a string for this? 
  • NsL Coder Profile Picture
    469 Super User 2025 Season 1 on 25 Jul 2024 at 02:53:09
    Adding a calendar event 6 months from listed date
    When you say it didn't seem to work, it will help us help you if you post what "didn't seem to work" means. Did the flow not allow you to save and say there is an error? did the flow saved, and you test run it, but errored out?
     
    A likely reason why the expression didn't work for you is the specific dynamic content used.
     
    addDays(triggerOutputs()?['body/CheckDate'], 183, 'yyyy-MM-ddT00:00:00')
     
    the first parameter of addDays takes in the dynamic content that is the date that was entered into the SharePoint list, which in this expression, the column/field name is CheckDate, this may or may not be what you have in your SP List. It is best that you start typing out the expression addDays, and then select the dynamic content that is your date column.
    See this link for what addDays function takes as parameter:
     
    adding 183 days may be good enough, but if you want exactly 6 months, you can check out addToTime expression:
     
    which allows you to add exactly 6 months.
  • nels99 Profile Picture
    20 on 24 Jul 2024 at 21:53:01
    Adding a calendar event 6 months from listed date
    Could you please explain the addDays function in relation to adding a date 6 months from the date on the list? I tried to copy the formula below but it didn't seem to work and I don't understand it enough to do it on my own. Thanks
  • Expiscornovus Profile Picture
    31,643 Most Valuable Professional on 23 Jul 2024 at 19:36:05
    Adding a calendar event 6 months from listed date
    You can use the addDays function for this. 
     
    Below is an example
    In this example a all day event is created for an item which has a date on 24/07. 
     
    Start Time
    addDays(triggerOutputs()?['body/CheckDate'], 183, 'yyyy-MM-ddT00:00:00')
     
    End Time
    addDays(triggerOutputs()?['body/CheckDate'], 184, 'yyyy-MM-ddT00:00:00')
     
     
    The list setup with the test item
     
     
    The result in Outlook 365 Group calendar
     
     
     
     
     
     
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started