What is the best possible way to display columns dynamically in a table record?

Consider a situation where I have n-number of columns in a database entity which I want to show on a screen using Table records widget. Consider the user with Admin Role has the option to select which columns to be displayed. On the basis of his selection, exact that number of columns need to be displayed in the TableRecords Widget.

What is the best way to do so?

Hi Shounak,

Table Records can't have a variable number of columns. What you can do, is design-time define all columns that can possibly be displayed, and per column switch it on or off based on configuration. To do so, add to both the header Cell and the body Cell an Extended Property "style" with value "display:none" (or "" depending on a condition).

Note however this is not an ideal solution, and best be used for a Table Records with a limited amount of columns, of which one or two are only displayed based on a Privilege. OutSystems is really not suited for having dynamic columns that can be configured by an administrator.

If the Columns are not changing very much Instead of Admin Role you can also use Site Properties. Along with what is mentioned in above reply.