Skip to main content
February 3, 2023
Solved

Count number or related records fi number is bigger than 10

  • February 3, 2023
  • 3 replies
  • 0 views

Hi.

I am experimenting with data fabric features and building record views Expression Base record types with Sync On.

I have 'Queue' Record type and 'Queue Item' Record type in 1:M relation. In a 'Queue' list, I need to see number of related 'Queue Items'.

I have created a column for that, see below. However, the highest number it can count is 10, then it stops counting. I guess that this is caused by logic to related to logic described here: https://docs.appian.com/suite/help/21.3/fnc_system_relatedrecorddata.html (..Number of related records to return. Valid values include 1-10..)

My question is, if there is some way around this? Simple count procedure should imo not be difficult enough to cause performance issues, especially in my case when the number of 'Queue' record types is low.

Thanks,

column definition that only returns 10:

a!gridColumn(
label: "Number of items in Q",
sortField: 'recordType!{3c05c063-58dc-48d3-b65d-a0e43dfc56bf}RM Queue.relationships.{9ec16658-ce64-4fbb-a1d0-0c3a3d6da8e5}rmQueueItem.fields.{cd05935f-e1c4-4f07-854f-51f79a19ccce}Id',
value: count(
fv!row['recordType!{3c05c063-58dc-48d3-b65d-a0e43dfc56bf}RM Queue.relationships.{9ec16658-ce64-4fbb-a1d0-0c3a3d6da8e5}rmQueueItem.fields.{cd05935f-e1c4-4f07-854f-51f79a19ccce}Id']
)
)

Best answer by stefanhelzle0001

You will need to do the counting using aggregations in the query. Loading all data to just count items is an anti-pattern.

3 replies

stefanhelzle0001
Brainy
February 3, 2023

You will need to do the counting using aggregations in the query. Loading all data to just count items is an anti-pattern.

janm0006Author
February 3, 2023

Thanks for reply. Do you know if there is a way to include record aggregation in a native record list?

stefanhelzle0001
Brainy
February 3, 2023