orderbyfield first field and then second field

604
3
Jump to solution
12-15-2021 02:01 AM
elpinguino
Occasional Contributor III

Hi there,

I'd like to set up a summary report ordered by date_created and then by stakeholder_group (text field).

I read the report documentation, but it looks like DESC only works for some field types? Or only for repeats? The data I'm working with are not repeats. Which ones? I got this error when I tried putting it into a non-numeric field. Have I interpreted the documentation incorrectly?

elpinguino_0-1639562336851.png

So is there a way to order fields first by the date_created field, and then further by stakeholder_group(alphabetically).

It would be easier for the client if a summary report could be exported as an excel spreadsheet. Is that on the cards at all for S123 report templates?

 

Tags (2)
1 Solution

Accepted Solutions
BarbaraWebster1
Esri Regular Contributor

Hi @elpinguino,

Yes, it is possible to apply an orderByFields filter based on one or more non-numeric fields. The filter can be applied to a repeat in an individual report or to the survey layer name (using the repeat syntax) in a summary section.

The syntax for that would look like this: ${#layer_name | orderByFields:"field1 DESC, field2 ASC"}

I attached an XLSForm, report template, and a report export that show an example of ordering a summary section by date and then by stakeholder. Hopefully that will help with your report template. 

There is an open idea for exporting reports in Excel format on ArcGIS ideas if you wanted to upvote and add your use case to it.

Thanks,
-Barbara 

View solution in original post

3 Replies
BarbaraWebster1
Esri Regular Contributor

Hi @elpinguino,

Yes, it is possible to apply an orderByFields filter based on one or more non-numeric fields. The filter can be applied to a repeat in an individual report or to the survey layer name (using the repeat syntax) in a summary section.

The syntax for that would look like this: ${#layer_name | orderByFields:"field1 DESC, field2 ASC"}

I attached an XLSForm, report template, and a report export that show an example of ordering a summary section by date and then by stakeholder. Hopefully that will help with your report template. 

There is an open idea for exporting reports in Excel format on ArcGIS ideas if you wanted to upvote and add your use case to it.

Thanks,
-Barbara 

elpinguino
Occasional Contributor III

Hi @BarbaraWebster1 . Thank you for your detailed reply. That was easy to follow, and now I've updated my word template.

What do you mean by the xls report template example though? Are you saying xls reports work in Survey123 now?

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Hi @elpinguino ,

Glad to hear that worked for you!

It isn't currently possible to export a report to an Excel document, but it has been submitted by another user as an idea for a future enhancement to Survey123. If you upvote the idea with a kudo and add a comment describing how that feature would be useful for your workflow, it will help the idea gain more visibility when the product team is deciding which new features to add. 

-Barbara