check the size of a CDT in bytes

Certified Senior Developer

Is there a function in Appian to check the size of the CDT in in bytes?? lenb() when i try gives the length of individual element in it. How do we get the size of the whole CDT as to what is sent to a WS??

OriginalPostID-181662

OriginalPostID-181662

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Let me know if this is on the wrong track here, but two different solutions come to me off the top of my head:

    1) lenb() called on an array will return the lenb() values for each individual member of the array, as you said. So wrap this call in sum(). IE, sum(lenb(local!cdtArray))

    2) cast the CDT to string first. i.e. lenb(tostring(local!cdtArray))

    Keep in mind that both of these solutions will be returning the total size of the data + the size of the field names, though that is also true of your initial approach.
Reply
  • 0
    Certified Lead Developer
    Let me know if this is on the wrong track here, but two different solutions come to me off the top of my head:

    1) lenb() called on an array will return the lenb() values for each individual member of the array, as you said. So wrap this call in sum(). IE, sum(lenb(local!cdtArray))

    2) cast the CDT to string first. i.e. lenb(tostring(local!cdtArray))

    Keep in mind that both of these solutions will be returning the total size of the data + the size of the field names, though that is also true of your initial approach.
Children
No Data