How to sort an array based on a field in one CDT that is nested in another CDT

Certified Associate Developer

Hi everyone, 

I'm having a CDT (CDT01) with fields: {id: int, name: text, information: {id: int,fieldId: int,address: text}}

As you can see, the information field contains a different CDT (CDT02) that is nested inside CDT01. 

I would like to sort a list of CDT01 based on CDT02.fieldId. Is there any solution for that? I tried toDataSubset and dataSubset but seems like I can only index the first layer of the CDT. 

Thanks for helping :)

  Discussion posts and replies are publicly visible