Hey all,
Hoping someone can help with this issue I'm facing regarding lists and tables.
Issue
When trying to add fields in the "Sort by" function for lists and tables, only certain fields seem to work. In the example below, I'm trying to sort by "Response Team Name", however when I click the field, it does not appear as an item to sort by, yet it does manipulate the order of the list.
Furthermore, some fields (like "Province") do seem to work as they appear as a sort by field. Oddly, when removing one instance of "Province", it remains for a few times which seem to be the initial fields that were selected (and present in the JSON), yet not displaying.
Additionally, when checking the JSON, for the initial fields that do not appear, it does write an "orderByFields" statement, but does not show up in the GUI for certain fields.
I also tried editing the JSON directly to see what would happen and it resulted in the same behaviour.
Likely Cause
The data source for the affected lists and tables is an Arcade Data expression which I'm guessing is the issue. The data expression performs a join from a parent dataset to three child tables as I could only achieve one join in a view layer.
However, the weird thing is that a field that works (e.g., "Province") is the exact same field type in both the hosted feature layer and the data expression (esriFieldTypeString) as fields that do not work (e.g., "Response Team Name").
The data expression that I used as a foundation to build mine can be found on the Github page here:
Question
Has anyone experienced this issue with sorting before or have some ideas on how to troubleshoot it? I'm going to try another data expression with only a single join and see if that behaviour persists, but thought I'd ask here.
Thanks all.
Solved! Go to Solution.
UPDATE: I found the cause of the issue! The process I used to create a data expression that joins related tables together (based off of this Github page) had an issue with it.
When building the dictionary that is returned as the FeatureSet for the data expression, the field names I used were formatted like aliases. E.g., Event Date vs. EventDate.
Sorting and filtering would work on fields where the names met field name criteria (i.e., no spaces, special characters, etc.), but would not work otherwise.
Changing field names to PascalCase solved the initial issue I was experiencing. I can now sort, filter, etc. all fields in the data expression as expected!
UPDATE: I found the cause of the issue! The process I used to create a data expression that joins related tables together (based off of this Github page) had an issue with it.
When building the dictionary that is returned as the FeatureSet for the data expression, the field names I used were formatted like aliases. E.g., Event Date vs. EventDate.
Sorting and filtering would work on fields where the names met field name criteria (i.e., no spaces, special characters, etc.), but would not work otherwise.
Changing field names to PascalCase solved the initial issue I was experiencing. I can now sort, filter, etc. all fields in the data expression as expected!