Excel and CSV download for datasources with custom sql ALIAS not working

In our app we have a dynamic list of columns for a table (that can be changed by the user) and want to provide an Export functionality. But since the “raw column header” are technical keys, we want to show a nice “label” instead. This is done using a custom SQL select statement that is loaded predefined from a datasource. (since we can not use valueMappings or other app-json things to dynamically select a subset of columns in the table).

The problem/suspicion: Is it possible that as soon as we use “SELECT i.column AS niceColumnName” (that is, an sql alias), the download options will not work anymore? I see the following error when trying to download something in such a table:

Data Table could not be retrieved: linkId is marked non-null but is null (reported error code: 500)

To update any future readers: After another round of investigations the reason for the error is not the alias, but the usage of dots in column identifiers, e.g. using

 SELECT col AS "col HH.MM" FROM inputTable

that causes the error. Further investigations will follow…

I know there is at least a future improvement idea about “Option to download table with column labels instead of technical ones”. So demand for such an option is known but currently not considered to get done due to other prioritized topics