cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tupaschoal
Level: Powered On

How to get last two weeks of data?

I've been trying to use Microsoft Flow to fetch all the meetings I had in the past two weeks, but I want to do it periodically, so I need an ODATA filter query for the Outlook "Get Events" action to limit the amount of data received.

I'm trying with Start gt {Now-14}, but it fails to work. Does anyone know if dynamic date ranges are even possible there?

Thanks!

19 REPLIES 19
Community Support Team
Community Support Team

Re: How to get last two weeks of data?

Hi @tupaschoal,

 

I think the issue here should be related with the date time format, please take a try with the following format:

Start/DateTime ge '2016-04-01T08:00'

For two weeks, try:

Start/DateTime ge '2016-04-01T08:00' and Start/DateTime le '2016-04-15T08:00'

57.PNG

58.PNG

For the syntax of the Odata filter, please see:

Resource reference for the Mail, Calendar, Contacts, and Task REST APIs

https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar

 

Search for "To get all the events in the user's default calendar that start on or after a specific date, you can filter on the Start property."

If you have any further questions, please feel free to post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: How to get last two weeks of data?

Adding another posts, 

If we would like to get the events from last two weeks, we might need to use the UTCnow() function and the Compose action to generate the corresponding date time.

Please check my another posts regarding the compose time:

https://powerusers.microsoft.com/t5/Flow-Forum/Start-and-end-times-when-creating-calendar-event/m-p/...

Use the adddays function instead of addhours() to switch the date range.

The formula in the Compose action should be:

"@adddays(utcnow(),-14)"

"@utcnow()"

59.PNG

60.PNG

If you have any further questions, please feel free to post  back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tupaschoal
Level: Powered On

Re: How to get last two weeks of data?

Hello @v-micsh-msft,

 

Thanks for the response, I didn't know how to use the Compose box and it seems integral to building complex flows.

Though the compose boxes work, I couldn't manage to make the "Get Events" filter the events properly, the filter query I used was:

 

Start/DateTime ge '2016-12-09T15:54:17.0468652Z' and Start/DateTime le '2016-12-23T15:54:17.3437361Z'

where the values come from the two compose actions you suggested. One event that I expected to be filtered (because it happened two months ago, not on the past two weeks) can be seen below (sensitive information was erased):

 

{
    "Id": "",
    "Attendees": [
      {
        "Status": {
          "Response": "None",
          "Time": "0001-01-01T00:00:00+00:00"
        },
        "Type": "Required",
        "EmailAddress": {
          "Name": "tupaschoal",
          "Address": "tupaschoal"
        }
      },
    ],
    "Body": {
      "ContentType": "HTML",
      "Content": ""
    },
    "BodyPreview": "",
    "Categories": [],
    "ChangeKey": "",
    "DateTimeCreated": "2016-09-27T17:17:45.5352294+00:00",
    "DateTimeLastModified": "2016-10-05T12:49:41.1377347+00:00",
    "End": "2016-10-05T14:00:00+00:00",
    "EndTimeZone": "E. South America Standard Time",
    "HasAttachments": false,
    "Importance": "Normal",
    "IsAllDay": false,
    "IsCancelled": false,
    "IsOrganizer": true,
    "Location": {
      "DisplayName": ""
      "Address": {
        "Street": null,
        "City": null,
        "State": null,
        "CountryOrRegion": null,
        "PostalCode": null
      },
      "Coordinates": {
        "Altitude": null,
        "Latitude": null,
        "Longitude": null,
        "Accuracy": null,
        "AltitudeAccuracy": null
      }
    },
    "Organizer": {
      "EmailAddress": {
        "Name": "tupaschoal",
        "Address": "tupaschoal"
      }
    },
    "Recurrence": null,
    "Reminder": null,
    "ResponseRequested": true,
    "ResponseStatus": {
      "Response": "Organizer",
      "Time": "0001-01-01T00:00:00+00:00"
    },
    "SeriesMasterId": null,
    "ShowAs": "Busy",
    "Start": "2016-10-05T12:30:00+00:00",
    "StartTimeZone": "E. South America Standard Time",
    "Subject": "",
    "Type": "SingleInstance",
  }

 
Thanks (:

Community Support Team
Community Support Team

Re: How to get last two weeks of data?

Hi @tupaschoal,

 

Thanks for the update.

I didn't noticed this as the calendar didn't contain any older events when I tested it before.

Just tried this time and I got the same results as yours.

The Get Events Action seems to ingore the Query inputed, I will take a further investigation on this.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tupaschoal
Level: Powered On

Re: How to get last two weeks of data?

Hello @v-micsh-msft, thanks for the quick reply (once again!). Please do let me know when you have a fix or workaround for it Smiley Happy

tupaschoal
Level: Powered On

Re: How to get last two weeks of data?

Any update on this matter @v-micsh-msft?

Community Support Team
Community Support Team

Re: How to get last two weeks of data?

Hi @tupaschoal,

 

Apologize for the late response.

No helpful results currently.

No matter how I change the format, the results are always the same. I will confirm the Odata Query part with others.

I will update here once I have any response.

Appreciate your patience.

Regards

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tupaschoal
Level: Powered On

Re: How to get last two weeks of data?

Thank you @v-micsh-msft, I'm just anxious to get this working Smiley Tongue

Have you considered that the filter might be ignored (incomplete implementation)?

Community Support Team
Community Support Team

Re: How to get last two weeks of data?

Hi @tupaschoal,

 

I got the response, confirmed the behavior that the filter Query is not working.

There should be changes (currently I didn't get any result regarding how it would be changed) be made on the filter query part.

Apologizes for the inconvenience caused by this.

Regards

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tupaschoal
Level: Powered On

Re: How to get last two weeks of data?

Thanks @v-micsh-msft. So basically it is a known bug with no ETA? That's sad.

Microsoft Employee

Re: How to get last two weeks of data?

I'm also interested in hearing when this bug is fixed.

tupaschoal
Level: Powered On

Re: How to get last two weeks of data?

Seems like it isn't gonna happen @michowl ):

Microsoft Employee

Re: How to get last two weeks of data?

@v-micsh-msft this bug needs to be fixed for the Outlook calendar Retrieve behavior to be much use. Please elevate this bug. I have 3 Flow scenarios waiting for this fix.
Community Support Team
Community Support Team

Re: How to get last two weeks of data?

Hi @tupaschoal,

 

The Flow team are working on this, but yes, currently there is no ETA.

 

@michowl,

 

Please consider submit this as an idea. I will vote for it, which I think is a much efficient way than what I could do from my side.

 

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Microsoft Employee

Re: How to get last two weeks of data?

@v-micsh-msft@tupaschoal

I've posted a Flow Idea to support this bug. Please support it at the following link:

https://powerusers.microsoft.com/t5/Flow-Ideas/Filter-Outlook-Events-by-date/idi-p/23361

tupaschoal
Level: Powered On

Re: How to get last two weeks of data?

Voted, @michowl.

@v-micsh-msft I just find it weird that we have to submit an idea when it is clearly a bug ):

Microsoft Employee

Re: How to get last two weeks of data?

Is there any update on this issue? The Outlook connector Get Events action is useless without filtering.

jsarnold
Level 8

Re: How to get last two weeks of data?

Any update?

ctw
Level: Powered On

Re: How to get last two weeks of data?

Has there been any updates on this matter? I'm trying to get entries from the past month on a SharePoint list and this seems relevant.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 140 members 4,554 guests
Recent signins:
Please welcome our newest community members: