如何在逻辑应用程序中编写 odata 时间段筛选器以访问 Outlook 日历事件?
How to write an odata time period filter in a logic app to access Outlook Calendar events?
我想从 Outlook 日历中获取今天开始的活动。我不知道如何将 API 调用中使用的查询格式转换为逻辑应用程序期望的格式。
我试过
'start' ge '2020-03-19-T07:33:33.707Z' and 'start' le '2020-03-26T07:33:33.707Z'
基本上是我编的
- 一些基于this answer的变体。
- 和 this answer 支持 odata 查询还为时过早
根据逻辑应用程序的 post-运行 查看器,数据是如下所示的对象列表:
{
"subject": "Working elsewhere (Not in the office)",
"start": "2020-03-18T21:00:00.0000000",
"end": "2020-03-18T21:00:00.0000000",
"body": "plenty of writing",
"isHtml": true,
"responseType": "notResponded",
"responseTime": "0001-01-01T00:00:00+00:00",
"id": "AAMkAGJkMGY5MTQzLWVhNDAzzAAAHYoGQAAA=",
"createdDateTime": "2020-03-19T02:44:49.558788+00:00",
"lastModifiedDateTime": "2020-03-19T02:44:49.7419829+00:00",
"organizer": "Clazbo@bvn.com.au",
"timeZone": "UTC",
"seriesMasterId": null,
"categories": [],
"webLink": "https://outlook.office365.com/owa/?itemid=AAxxD&exvsurl=1&path=/calendar/item",
"requiredAttendees": "clazbo@bvn.com.au;",
"optionalAttendees": "wherebot@bvn.com.au;",
"resourceAttendees": "",
"location": "",
"importance": "low",
"isAllDay": false,
"recurrence": "none",
"recurrenceEnd": null,
"numberOfOccurences": null,
"reminderMinutesBeforeStart": 960,
"isReminderOn": true,
"showAs": "free",
"responseRequested": false
},
这个问题有两个相关部分:
- 如何构造查询?它的语法是什么?
- 如何让日期 window 滚动(我假设它类似于
start ge formatDateTime(utcnow(),'yyyy-MM-dd') and start le formatDateTime(utcnow() + 1,'yyyy-MM-dd')
)
您可以只使用下面的过滤器查询来执行此操作:
Start/DateTime ge '2020-03-01T08:00' and Start/DateTime le '2020-03-25T08:00'
如果你不想要时间,使用下面的查询就可以了:
Start/DateTime ge '2020-03-01' and Start/DateTime le '2020-03-25'
如果你想在logic app中使用utcnow(),请参考下面的截图:
截图中formatDateTime()的两个表达式为:
formatDateTime(utcnow(),'yyyy-MM-dd')
formatDateTime(adddays(utcnow(), 7),'yyyy-MM-dd')
请注意截图中formatDateTime()
表达式前后的符号'
。
希望对你有帮助~
我想从 Outlook 日历中获取今天开始的活动。我不知道如何将 API 调用中使用的查询格式转换为逻辑应用程序期望的格式。
我试过
'start' ge '2020-03-19-T07:33:33.707Z' and 'start' le '2020-03-26T07:33:33.707Z'
基本上是我编的- 一些基于this answer的变体。
- 和 this answer 支持 odata 查询还为时过早
根据逻辑应用程序的 post-运行 查看器,数据是如下所示的对象列表:
{
"subject": "Working elsewhere (Not in the office)",
"start": "2020-03-18T21:00:00.0000000",
"end": "2020-03-18T21:00:00.0000000",
"body": "plenty of writing",
"isHtml": true,
"responseType": "notResponded",
"responseTime": "0001-01-01T00:00:00+00:00",
"id": "AAMkAGJkMGY5MTQzLWVhNDAzzAAAHYoGQAAA=",
"createdDateTime": "2020-03-19T02:44:49.558788+00:00",
"lastModifiedDateTime": "2020-03-19T02:44:49.7419829+00:00",
"organizer": "Clazbo@bvn.com.au",
"timeZone": "UTC",
"seriesMasterId": null,
"categories": [],
"webLink": "https://outlook.office365.com/owa/?itemid=AAxxD&exvsurl=1&path=/calendar/item",
"requiredAttendees": "clazbo@bvn.com.au;",
"optionalAttendees": "wherebot@bvn.com.au;",
"resourceAttendees": "",
"location": "",
"importance": "low",
"isAllDay": false,
"recurrence": "none",
"recurrenceEnd": null,
"numberOfOccurences": null,
"reminderMinutesBeforeStart": 960,
"isReminderOn": true,
"showAs": "free",
"responseRequested": false
},
这个问题有两个相关部分:
- 如何构造查询?它的语法是什么?
- 如何让日期 window 滚动(我假设它类似于
start ge formatDateTime(utcnow(),'yyyy-MM-dd') and start le formatDateTime(utcnow() + 1,'yyyy-MM-dd')
)
您可以只使用下面的过滤器查询来执行此操作:
Start/DateTime ge '2020-03-01T08:00' and Start/DateTime le '2020-03-25T08:00'
如果你不想要时间,使用下面的查询就可以了:
Start/DateTime ge '2020-03-01' and Start/DateTime le '2020-03-25'
如果你想在logic app中使用utcnow(),请参考下面的截图:
截图中formatDateTime()的两个表达式为:
formatDateTime(utcnow(),'yyyy-MM-dd')
formatDateTime(adddays(utcnow(), 7),'yyyy-MM-dd')
请注意截图中formatDateTime()
表达式前后的符号'
。
希望对你有帮助~