UiPath中Get Outlook Mail Message过滤属性报错的解决咨询
修复UiPath Get Outlook Mail Messages的SQL过滤条件报错
问题根源
你的过滤条件存在两个核心问题:
- 直接使用
[Received]不符合Outlook SQL查询的语法规范,必须使用对应的MAPI属性标签或标准URN格式属性名 - 日期格式写法不被Outlook解析,需要严格遵循
yyyy-MM-dd HH:mm:ss格式
修复方案
方案1:使用MAPI属性标签
替换原过滤代码为:
"@SQL=""http://schemas.microsoft.com/mapi/proptag/0x0037001f"" LIKE '%asean prs%' AND ""http://schemas.microsoft.com/mapi/proptag/0x0E060040"" >= '" + DateTime.Today.ToString("yyyy-MM-dd 00:00:00") + "'"
0x0037001f对应邮件主题属性0x0E060040对应邮件接收时间属性- 日期统一用
yyyy-MM-dd HH:mm:ss格式,确保Outlook能正确解析
方案2:使用更易读的URN格式
如果觉得MAPI标签难记,可改用URN格式的属性名:
"@SQL=""urn:schemas:httpmail:subject"" LIKE '%asean prs%' AND ""urn:schemas:httpmail:datereceived"" >= '" + DateTime.Today.ToString("yyyy-MM-dd 00:00:00") + "'"
优化写法(可选)
用String.Format让代码结构更清晰:
String.Format("@SQL=""urn:schemas:httpmail:subject"" LIKE '%asean prs%' AND ""urn:schemas:httpmail:datereceived"" >= '{0}'", DateTime.Today.ToString("yyyy-MM-dd 00:00:00"))
内容的提问来源于stack exchange,提问作者alvin
相关产品推荐
相关产品推荐

