Table column attributes data

I have the results of a query I need to display in a table. Among other info, the results have 2 columns, one in English and the other in Portuguese. Aside from modifying the query to return the appropriate column, can I just access the hidden property of the column attr data to toggle either of these on of off depending on the user selection?

Yes, you can toggle the visibility for the columns based on user input. You just need to use the system.dataset.updateRow() function on the columnAtributesData property of the table. If you haven’t used it before, there is a great example of how to use it in the help files in Appendix C.

Also, you can make your SQL query dynamic and only select the column in the language you want.

If it were me, I'd probably go with the query modification route. Much easier for someone else coming into the project to understand. You could do something like store the current language preference in a client tag that represented one of the two column names, and then the query would be something like:

SELECT some_column, some_other_column, {[Client]CurrentLang} FROM MyTable ...

Nice and clean, and automatically updates the query if the value of the CurrentLang tag changes.