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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need to show all appoi...
Power Automate
Unanswered

Need to show all appointments that occur before a certain date

(0) ShareShare
ReportReport
Posted on by 5

Hi

 

I have created a flow that links to a Sharepoint calendar.  The flow will successfully show any appointments that occur a set number of days away and send me an email.  However i would like the flow to show all appointments that occur in that time period.

 

Below is an example of my calendar

ITAnna_0-1694086632722.png

 

Currently my flow sends me an email and shows the 2 appointments that occur 14 days away on 21 September.  However i would like it to send me an email showing any appointment between today and 14 days.

 

My current expression is 

addDays(utcnow(), int(outputs('RenewalPeriod')), 'yyyy-MM-dd')
 

Could you direct me to the best expression to achieve this

 

Thanks in advance 

Anna

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @ITAnna 

     

    You need to write an expression to include date ranges. Here is an example, 'EventDate' is the field that specify the start time of the event:

    ManishSolanki_0-1694089504915.png

    Filter query used here:

    EventDate ge '@{startOfDay(utcNow())}' and EventDate lt '@{startOfDay(addDays(utcNow(),15))}'

    Pls replace 'EventDate ' with the actual field name.

     

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

     

    Thanks

     

  • ITAnna Profile Picture
    5 on at

    Hi @ManishSolanki 

    Thanks for the reply and explanation. I have tried your code above and it errors.  Below is a screenshot of my flow. It says RenewalPeriod does not exist but i have this in the flow. I think i am overcomplicating something that should be really straight forward

     

    ITAnna_0-1694091981498.png

    I am trying to create an email that sends once a month, all appointments that occur in the next 60 days.  The example shows 14 as i am working with dummy data at the minute.

    Is there a neater way of doing this?

     

    Any assistance would be greatly appreciated

     

    Anna

     

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @ITAnna 

     

    As Filter query works on the internal name of the fields or columns so "Get items" action could not find the field and failed.

     

    To get the internal name of the field, pls follow the below steps:

     

    Go to SharePoint list settings and scroll down to 'Columns' section & click the required column (here I am looking for internal name of 'Start Time' field):

    ManishSolanki_0-1694093818832.png

     

    Next, locate the query parameter "Field" in the URL. The value of this parameter is the internal name of the field (part after Field= in the URL):

    ManishSolanki_1-1694094005762.png

    Now we know the internal name of "Start Time" field which is "EventDate". We will use this name in the filter query of "Get items" action to get the required records:

    EventDate ge '@{startOfDay(utcNow())}' and EventDate lt '@{startOfDay(addDays(utcNow(),15))}'

    Pls adjust the value in addDays() function as per your need.

     

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

     

    Thanks

  • ITAnna Profile Picture
    5 on at

    great explanation, let me try this 

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard