Is it possible to fetch a CDT field by numerical index?

Hi all,

I want to get fields in a CDT based on their numerical index, i.e. if I have a CDT like:

{'type!{urn:com:appian:types:TEST}TEST_Employee'('firstName': "Frank", 'secondName': "Smith", 'age': 29)}

To get the first field, is there a way to index it by number? Something like index(local!testCdt, 1, null) would return "Frank". 

Thanks for your help!

  Discussion posts and replies are publicly visible

Parents Reply
  • Keep in mind that this is dependent on the original structure and ordering of the CDT, not necessarily on what data is provided. So in your example even if "firstName" is the first key you provide in your expression, if the CDT has a different first field (e.g. ID), then it will always return the ID instead.

    Like Stefan mentioned below, I'm curious how you plan to use this - there may be other approaches that could achieve what you're looking for more consistently.

Children