azure-logic-apps - 如何在逻辑应用中编写 odata 时间段筛选器以访问 Outlook 日历事件?
问题描述
我想从 Outlook 日历中获取今天开始的事件。我不知道如何将 API 调用中使用的查询格式转换为逻辑应用程序所期望的格式。
我试过像
'start' ge '2020-03-19-T07:33:33.707Z' and 'start' le '2020-03-26T07:33:33.707Z'
基本上是我编的- 基于此答案的许多变体。
- 这个答案还为时过早,无法支持 odata查询
根据逻辑应用的运行后查看器,数据是如下所示的对象列表:
{
"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
},
这个问题有两个相关的部分:
- 如何构建查询?它的语法是什么?
- 如何保持日期窗口滚动(我假设它类似于
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'
如果你想在逻辑应用中使用 utcnow(),请参考下面的截图:
截图中formatDateTime()的两个表达式为:
formatDateTime(utcnow(),'yyyy-MM-dd')
formatDateTime(adddays(utcnow(), 7),'yyyy-MM-dd')
请注意截图中表达式'
前后的符号。formatDateTime()
希望有帮助~
推荐阅读
- firebase - 更改 Firebase Firestore 服务器位置
- apache-storm - KafkaSpout 中的异常
- python - 转换为整数数字字符串熊猫数据框
- android - 关于网格项目点击的自动滚动粘性标题
- laravel - Laravel:将请求转换为另一个
- azure - Azure AD 图形资源管理器 - 读取所有组权限
- android - 带有 Android 的 rk3399 板上的 opencv 3.4 NDK(版本 >= 7.1,API >= 26)
- java - HTTP 请求后从 Camel 确认 AMQ
- office-js - Office.js 从 Word 在线获取评论
- maven - TestNG - 并行执行测试套件