You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Logic Apps问题:JSON解析失败,无法基于最后登录活动筛选用户数据

问题修复与解决方案

1. 修正Parse JSON的Schema错误

你提供的JSON Schema中,signInActivity下的日期字段类型写成了大写的"String",这不符合JSON Schema规范(类型需小写),导致Parse JSON组件无法正确识别这些字段。修改后的signInActivity部分Schema如下:

"signInActivity": {
    "properties": {
        "lastNonInteractiveSignInDateTime": {
            "type": [
                "string",
                "null"
            ]
        },
        "lastNonInteractiveSignInRequestId": {
            "type": [
                "string",
                "null"
            ]
        },
        "lastSignInDateTime": {
            "type": [
                "string",
                "null"
            ]
        },
        "lastSignInRequestId": {
            "type": [
                "string",
                "null"
            ]
        }
    },
    "type": "object"
}

2. 确保Graph API返回signInActivity数据

调用Microsoft Graph API获取用户数据时,必须显式指定$select包含signInActivity,否则默认不会返回该属性。同时可以直接通过API过滤拥有Office 365 E1许可证的用户(E1的SKU ID为6fd2c87f-b296-42f0-b197-1e91e994b900),示例请求:

GET https://graph.microsoft.com/v1.0/users?$select=displayName,userPrincipalName,accountEnabled,signInActivity,assignedLicenses&$filter=assignedLicenses/any(x:x/skuId eq 6fd2c87f-b296-42f0-b197-1e91e994b900)

3. 筛选非活跃用户

修复Parse JSON后,即可在Logic Apps中添加条件判断,筛选满足以下条件的用户:

  • lastSignInDateTime 早于你定义的过期日期(比如90天前)
  • lastNonInteractiveSignInDateTime 早于同一过期日期
  • (可选)accountEnabled 为true(如果仅筛选启用状态的非活跃用户)

内容的提问来源于stack exchange,提问作者Shaktisinh Vaghela

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 00:07:36