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.
Discussion posts and replies are publicly visible
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
a!keys()
https://docs.appian.com/suite/help/23.1/fnc_informational_a_keys.html
While it does get the fields; it only does so if they are filled with dataunlike the CDTs
Yanal if you provide value for all the fields (as shown as following) you will get all the field names.
a!keys( recortType!RDW_REC_Comment(RDW_REC_Comment.id: 1, RDW_REC_Comment.user_r: "test", .... )
a!keys() - takes record as input not the recordType.
a!keys value
Returns the keys of the provided map, dictionary, CDT, or record.
value (Any Type): The map, dictionary, CDT, or record whose keys should be returned.
-While it does get the fields; it only does so if they are filled with data-unlike the CDTsThat's what I said mate, the trick is on how to get the fields names without them having a value, like in the CDTs case.
I am also looking for same. But itssem we have just record type constructor, which have limitations that unless we type field it wont add. like
Peter Lewis, is this something you can help us with? I also have a use case where is see a problem with a!keys() ignoring empty fields.
This is expected behavior - record data types behave more similarly to maps in that it's possible that some keys are not present in the data type. This is beneficial for operations like using the Write Records node since we are able to only write fields that are present (and ignore other fields).
However, if you need to get all the fields the approach I have typically taken is to just query a single row of data and use that to get the relevant fields. Just curious, how do you plan to use the list of fields in your app?
I created a very dynamic component that takes any data structure and renders it to screen.
This is mostly meant to just get started quickly. But it can also be customized to death and be used as a replacement for a hand-crafted UI.
And it would be great if a!keys would return all fields, or at least has a parameter to make it do it.
All the keys of any record can be retrieved by providing dummy values to all the fields. This is how it works. Any feature upgrade request should be sent to Appian support and they might evaluate to see the feasibility.