Azure lastSignInDateTime transform

I have issue with below transform. Its always returns “negativeCondition”

My input date is 2023-11-13T15:21:29Z

{
    "id": "68d3d8fa-fb61-4fb3-8bd3-",
    "name": "Azure Lastlogin Transform",
    "type": "static",
    "attributes": {
        "Logindate": {
            "attributes": {
                "negativeCondition": "active",
                "positiveCondition": "inactive",
                "firstDate": {
                    "attributes": {
                        "input": {
                            "attributes": {
                                "input": {
                                    "type": "firstValid",
                                    "attributes": {
                                        "values": [
                                            {
                                                "attributes": {
                                                    "sourceName": "lastSignInDateTime",
                                                    "attributeName": "Azure Active Directory"
                                                },
                                                "type": "accountAttribute"
                                            },
                                            {
                                                "type": "static",
                                                "attributes": {
                                                    "value": "3000-01-01T00:00:00Z"
                                                }
                                            }
                                        ]
                                    }
                                },
                                "inputFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'",
                                "outputFormat": "ISO8601"
                            },
                            "type": "dateFormat"
                        },
                        "expression": "+180d"
                    },
                    "type": "dateMath"
                },
                "secondDate": "now",
                "operator": "lt"
            },
            "type": "dateCompare"
        },
        "value": "$Logindate"
    },
    "internal": false
}

I think that you need to dateFormat, back to ISO8601, the output after the dateMath, before you do the dateCompare:

The output format for the DateMath transform is “yyyy-MM-dd’T’HH:mm”. When you use this transform inside another transform (e.g., dateCompare), make sure to convert to ISO8601 first.

Hi @Manju22 ,

Can you try splitting this into small pieces and test the transform to see if you get the proper output in all the transforms? Also, make sure to convert the Date to ISO8601 and compare.

Regards,
Karthi

Thanks for the feedback, I still gets the wrong value

{
    "id": "68d3d8fa-fb61-4fb3-8bd3-04c7cffa8cd2",
    "name": "Azure Lastlogin Transform",
    "type": "static",
    "attributes": {
        "Logindate": {
            "attributes": {
                "negativeCondition": "active",
                "positiveCondition": "inactive",
                "firstDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "attributes": {
                                "expression": "+180d",
                                "input": {
                                    "attributes": {
                                        "input": {
                                            "type": "firstValid",
                                            "attributes": {
                                                "values": [
                                                    {
                                                        "attributes": {
                                                            "sourceName": "lastSignInDateTime",
                                                            "attributeName": "Azure Active Directory"
                                                        },
                                                        "type": "accountAttribute"
                                                    },
                                                    {
                                                        "type": "static",
                                                        "attributes": {
                                                            "value": "3000-01-01T00:00:00Z"
                                                        }
                                                    }
                                                ]
                                            }
                                        },
                                        "inputFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'",
                                        "outputFormat": "ISO8601"
                                    },
                                    "type": "dateFormat"
                                },
                                "roundUp": true
                            },
                            "type": "dateMath"
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    }
                },
                "secondDate": "now",
                "operator": "lt"
            },
            "type": "dateCompare"
        },
        "value": "$Logindate"
    },
    "internal": false
}

Try changing this:

{
  "attributes": {
    "sourceName": "lastSignInDateTime",
    "attributeName": "Azure Active Directory"
  },
  "type": "accountAttribute"
}

to this:

{
  "type": "static",
  "attributes": {
    "value": "2023-11-13T15:21:29Z"
  }
}

And see if that gets you the correct result

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.