How do I choose specific columns, order columns, and alias columns that are not primitive types?
Discussion posts and replies are publicly visible
You can use dot notation in both the field and alias to select specfic fields and define the output. For example, if you want to the fields "reworkNew" and "reworkOld" from the nested cdt, you can provide the dot notation directly in the columns like this with a top level alias used:
... a!queryColumn( field: "reworkRoutes.reworkNew", alias: "reworkNew" ), a!queryColumn( field: "reworkRoutes.reworkOld", alias: "reworkOld" )
If you do this, you will see "reworkNew" and "reworkOld" as fields at the top level of the dictionary.
Thank you for the suggestion. I tried that but received this error.
Ah this only works if you have a nested 1:1 and M:1 relationship. In general we recommend against using nested 1:M relationships because (1) it is more difficult to index data out of and (2) the performance is usually not as good. See the CDT guidance for more information. In this case I'd recommend creating multiple queries: one to get the data from the first entity and a second to query from the second entity. Then you would have more control over getting each individual field.