Dynamic Column

How to program to hide Column base on the user role?
Hi Richard,

Could you provide more details?
Do you want to hide an tableRecord column?

Rafael Pereira
Hi Rafael,

Yes, I would like to hide an tableRecord column base on the user role.

For instead, there are 4 column. A, B, C, D.

User A only want to see column A, C, D.

User B only want to see column B,C,D.

Hi Richard,

It's simple. You can do this using a IF widget "around" the tablerecord expression.

Or as a second approach, using a conditional expression to present the result. 

Rafael Pereira


You can use the following in extended properties of table cells

Name1: style
Value 1: if ( condition with user role, "display:none", " ")
Be aware that using Hugos' technique should be done together with the IF widget that Rafael mentioned.
Hugo's approach only hides the information client side (on the browser) which is great if you want to use javascript to show/hide it, but not the best approach if the user does not have permissions - he would be able to "View Source" in the browser, and the information will be there.
Hi Rafael,

Your suggested method will hide the Contents of the data. The column title still display.

Is there anyway to fide entire Column (Title & contents)?

Hi Richard,

You can use the if-widget to hide the column header as well, just like you did with the value. This will hide the complete column, or at least make it very small, depending on the browser you're using.


You can use a mix with if-widget and a javascript code.

Use an if-widget to hide a data and a javascript that I recomended to hide completely column.

Best Regards,
- if it's really A,C,D and B,C,D then it's much simpler.

1 A/B column with an if in the header and the row-cell
C column
D colum

or make a expression in the columns
the expression will "split" cells or not
like for the header:  if(administrator, "Username</td><td>Password", "Username") with escape-content on false
and same for the cell, only with the values ofcourse.

as you can see, more ways to Rome, erm, Lissabon ;)

Looking into to a Tutorial within Version 5.1
Tutorial name: Create a Web Page to List Data

In the Contact_List page,
It uses a simple query to get contacts from database.
Display the specific Columns but not all the Columns

Here is the question, how to display the specific Columns?
Hi Richard,

I don't have the full context, but you can display specific columns in the a Table Records widget by dragging only the desired entity attributes to it.

Is this what you are looking for?


Paulo Tavares
Hi Richard,

One more try, now using colors to explain :) 

1) Open your WebScreen
2) Navigate to the Entities section on the right TreeView (Green Area)
3) Expand the desired entity and drag the column from the entity (Blue Area) to the table record "dump" column (Yellow Area).



Rafael Pereira
Since I cannot edit the last post :(

New resized image version: