Sort organizations by number of facilities in fetch


I’m looking to fetch all organizations and sort by the number of facilities associated with that organization (in C3 Energy Management).

Assume this is something like
order: “descending(??)”

Any guidance appreciated!


I would try with evaluate, for instance:

  projection: 'name, count(denormFacilities)',
  group: 'name',
  order: 'count(denormFacilities)'
1 Like

You could add a stored calc field on Organization and order by that.

1 Like