Hello,
when a record type has a (1,n) relation, Appian supports some aggration for those related records ( 'Create Custom Record Field' --> 'AGGREGATE RELATED RECORD FIELDS').
The avaible aggregation functions seem to be dependend on the data type of the 'AGGREGATE RELATED RECORD FIELDS' - in any case, I'm looking for something like FIRST_OF (LAST_OF) so that I can get the first record field(s) of related data records (which are string based).
Maybe a small example: (Author) <-- (Books) (an author can have many books)
Should be presented in a list
What would be a good way to achieve this?
Thank you in advance
Thomas
Discussion posts and replies are publicly visible
Well, figured: I'm required to change this manually - I did this and now its working.
Thank you.
I assume, the more correct solution is already posted - what also _seems_ to work is (within the record type) the following:
Add a column to the list (within the record type) and give only the first record for an 1-many relationship, if any. The order would be kind of undefined I assume) - so I'll go with the correct answer already mentioned here.
Actually what I would recommend is not using an expression rule at all - the query is an example for how the data is returned, but you can directly call the record type as the source of your grid instead (which I think will be easier to configure and change as necessary).
To do this, you can use a!recordData() as the "data" parameter and add your usage of a!relatedRecordData() inside of that function.
Here's more information about this from the grid documentation.
Until now, I was under the impression that assigning data records to a rule expression enhances reusability. I've also found the option on the help page (grid documentation).
Thank you for sharing this best practice - appreciate it.
In general I actually suggest using the grid over using a reusable expression rule because the grid can be more efficient (since it only queries fields that are used in the columns of your grid) and it is easier to configure