How to return true value for null list of records

Certified Senior Developer

I just want to understand why list of records(0 items) is not returning null/true in below scenarios.

I have problem returning the List of Empty Records to be empty/null.

Any thoughts??

We always practiced using null vs 0 vs "" vs {} depending on the type of data. However here {} for set of array records is not working to identify as null. Of course same behavior with CDT's as well.

  Discussion posts and replies are publicly visible

Parents
  • This is the known behaviour of a!isnull() and a!isnullOrEmpty() also, as it probably uses length() function to check if a value is null which would return 1 for a null CDT or record. You can consider it as a best practice to use the below code to check null values for CDTs and Records specially.

    {
      a!isNullOrEmpty({}),
      cast(type!Map,{}) = a!map(),
      cast('recordType!{aa4ce38f-1a9d-4827-af51-e2ccb80a2c8b}AS Vehicle',{}) = ri!value,
      cast(type!{urn:com:appian:types:PA}PA_AA_VEHICLE,{}) = ri!cdt
    }

Reply
  • This is the known behaviour of a!isnull() and a!isnullOrEmpty() also, as it probably uses length() function to check if a value is null which would return 1 for a null CDT or record. You can consider it as a best practice to use the below code to check null values for CDTs and Records specially.

    {
      a!isNullOrEmpty({}),
      cast(type!Map,{}) = a!map(),
      cast('recordType!{aa4ce38f-1a9d-4827-af51-e2ccb80a2c8b}AS Vehicle',{}) = ri!value,
      cast(type!{urn:com:appian:types:PA}PA_AA_VEHICLE,{}) = ri!cdt
    }

Children