Skip to main content
philips781
July 5, 2021
Question

Is there a way to get the list of fields on a record using an expression?

  • July 5, 2021
  • 15 replies
  • 1 view

Is there a way to get the list of fields on a record using an expression? See example below on potential usage.

a!forEach(
  items: 'recordType!{SYSTEM_RECORD_TYPE_USER}User'.fields,
  expression: fv!item
)

If this is not currently supported it would be a great addition that would open up many interesting use cases.

    15 replies

    stefanhelzle0001
    Brainy
    July 5, 2021

    There is a plugin providing this functionality.

    https://community.appian.com/b/appmarket/posts/cdt-manipulation

    Which use cases are you thinking about? Fully dynamic interfaces?

    philips781
    July 5, 2021

    Hi Stefan,

    Thanks for the response. Yes, I am familiar with that plugin. I would however like to make use of the latest record features instead if possible, i.e. custom fields and relationships on synced records. Yes, we have a use case that would benefit from accessing the record fields dynamically.

    I don't believe it is currently possible but thought I would put the question out there in any case. I do have a workaround although not ideal, i.e. create an expression rule that returns a list of record type field references explicitly. For example.

    {
      'recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{firstName}firstName',
      'recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{lastName}lastName'
    }

    Kind Regards,

    Philip Snyman

    stefanhelzle0001
    Brainy
    July 5, 2021

    OK. Got it. Why not just cast the record type to its CDT type?

    There is a ugly hack from the old days using toxml and xpath to extract the field names. Did not test this with a record type.

    April 4, 2023

    yanaln6436
    April 4, 2023

    Kudos for trying mate, but this will get all the values for the 'nombre' field for all areas, what OP asked is how to get the fields themselves not the values

    stefanhelzle0001
    Brainy
    April 4, 2023