Null check fails

Hi,
I am validating Null data for date column. if date is not coming from feed,i would like to put some message in output. below code shows that “missing” message for all identities even the dates are coming in feed. please let me know where is the error in this code.

{    
    "type": "static",
    "attributes": {
        "startDate": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "attributes": {                            
                            "input": {
                                "type": "dateFormat",
                                "attributes": {
                                    "inputFormat": "dd/MM/yyyy",
                                    "outputFormat": "ISO8601",
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "sourceName": "",
                                            "attributeName": "StartDate"
                                        }
                                    }
                                }
                            }
                        },
                        "type": "dateMath"
                    },
                    "Missing"
                ]
            }
        },
        "value": "$startDate"
    },
    "internal": false
}

Thanks
Stella

Hi @stellaantony,

I don’t think DateMath is necessary as it is not doing any operation. Try using this one:

{
    "type": "static",
    "attributes": {
        "startDate": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "type": "dateFormat",
                        "attributes": {
                            "inputFormat": "dd/MM/yyyy",
                            "outputFormat": "ISO8601",
                            "input": {
                                "type": "accountAttribute",
                                "attributes": {
                                    "sourceName": "",
                                    "attributeName": "StartDate"
                                }
                            }
                        }
                    },
                    "Missing"
                ]
            }
        },
        "value": "$startDate"
    },
    "internal": false
}

It works for date. Thank you so much. Same is failing for just string data.

"deptName": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "input": {
                                "type": "accountAttribute",
                                "attributes": {
                                    "sourceName": "",
                                    "attributeName": "Department Name"
                                }
                            }
                        }
                    },
                    "Missing"
                ]
            }
        },

Any suggestions please.
Thanks

Double check the attribute name from the account schema. Try this:

{
    "attributes": {
        "values": [
            {
                "attributes": {
                    "sourceName": "",
                    "attributeName": "Department Name"
                },
                "type": "accountAttribute"
            },
            "Missing"
        ]
    },
    "type": "firstValid",
    "name": "Test First Valid Transform"
}
2 Likes

Thank you Animesh. it works. Thanks again.

2 Likes

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