Feature Reports orderByFields syntax

1103
3
06-03-2021 06:09 AM
AnthonyJonesRSK
Occasional Contributor II

Hi,

I'm having a bit of trouble with the syntax for the orderByFields parameter in my report template. In the help section it provides the example ${defects | orderByFields:"state_name ASC, pop2000 DESC"}. In my example I'm applying this to a nested repeat and have tried the following;

${#MaintenanceDetails}${#Notifications}${Notifications|orderByFields:"NotificationBoQRef DESC"}${NotificationBoQRef}${/}${/}

This didn't work and I just end up with an unsorted list of repeats each with [object Object] preceding them. I then tried the alternative below with the orderByFields parameter added to the repeat placeholder for the start of the repeat;

${#MaintenanceDetails}${#Notifications|orderByFields:"NotificationBoQRef DESC"}${NotificationBoQRef}

In this version the sorting works but I end up with my repeat values being duplicated multiple times. You can see in the image below how the values D6 and D4 appear again at the bottom of the list. Can someone please provide some guidance on the syntax or confirm whether this is a bug associated with nested repeats?

I also need to combine the orderByFields parameter with some if statements to limit the repeats pulled into the report and wondered whether the "where" clause utilised in summary reports and demonstrated by Ismael here can be used within the regular reports? It did seem to work when I tried it but the orderbyFields parameter still wouldn't work.

Any help would be much appreciated.

Thanks

Anthony

AnthonyJones5_0-1622725029165.png

@IsmaelChivite @JamesTedrick 

0 Kudos
3 Replies
JodyZhengLiu
Esri Contributor

Hi @AnthonyJonesRSK ,

Is it possible to share the xlsx file and report template so we can reproduce this issue quicker? You can send them to my email zliu@esri.com

Thanks,

Jody Zheng Liu

 

0 Kudos
NickMoore
New Contributor III

@JodyZhengLiu @IsmaelChivite @JamesTedrick 

We are also experiencing the same behaviour with orderbyfields within a nested repeat. Grandparent > Parent > Child

We have tested numerous iterations and what seems to be happening as soon as you apply an orderbyfields to the nested repeat table (Child), it returns all records from the Child associated through the parent but at the Grand Parent level. i.e. not filtering to the relevant Parent. Thus in the FRT report the parent shows all child records regardless of relationship to the parent.

Data example here

  • Site (Grandparent) - siteid: AB1
    • Strata (Parent) - strata: T
      • Specie (Child) specie: acacia
      • Specie (Child) specie: xyz
    • Strata (Parent) - strata: G
      • Specie (Child) specie: abc
      • Specie (Child) specie: def

The FRT Report with orderbyfield on species does this (note sorted)

  • Site (Grandparent) - siteid: AB1
    • Strata (Parent) - strata: T
      • Specie (Child) specie: abc
      • Specie (Child) specie: acacia
      • Specie (Child) specie: def
      • Specie (Child) specie: xyz
    • Strata (Parent) - strata: G
      • Specie (Child) specie: abc
      • Specie (Child) specie: acacia
      • Specie (Child) specie: def
      • Specie (Child) specie: xyz

We think this is a bug within the FRT and order by in the nested repeats

Regards
Nick

 

survey123_solutions
New Contributor III

Having the same issue and know that it could be a quick fix for my issue as well.

Thanks so much zliu@esri.com.

0 Kudos