Computing not null values in a CDT

Hi,

I have a CDT which has around 50 attributes, I am required to find the count of not null attributes in my CDT. Is there a way I can do this by not creating a counter which would get updated after 70 if-else checks?

For Example:

Employee_cdt{fName:"Abc",lName:"Def",mName:"",empId:1234,empDept:""...}

A rule to return the not null attributes for Employee_cdt.

 

Thanks,

Arjun

  Discussion posts and replies are publicly visible

Top Replies

Parents
  • Hello Arjun,

    If you only want to fetch the details which are having all values (not contain null).

    Then use logicalExpression:-
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters:{
    a!queryFilter(
    field:"fieldA",
    operator:"not null"

    ),
    a!queryFilter(
    field:"fieldB",
    operator:"not null"
    )........
    )

    then you will only get the value with the fields you mentioned not null.
Reply
  • Hello Arjun,

    If you only want to fetch the details which are having all values (not contain null).

    Then use logicalExpression:-
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters:{
    a!queryFilter(
    field:"fieldA",
    operator:"not null"

    ),
    a!queryFilter(
    field:"fieldB",
    operator:"not null"
    )........
    )

    then you will only get the value with the fields you mentioned not null.
Children
No Data