Conditionally hide column in table layout.

Hi,

We have a requirement to conditionally hide some columns in a table layout based on User roles.
I have added when rule (“Never”) on the column header and column value still the column is visible but this time the column values are hidden.

But my requirement is to hide the entire column.

I have referred the below post but it suggests to use Inline styling which comes with a warning.

Is there any other approach to hide the entire column conditionally?

Hi,

You can add inline styling for conditionally hiding table columns. This is absolutely fine.

Please read the warning. It suggests that you should not to write custom CSS styles in the inline styles but you are rather writing a logic which is okay and can be ignored in this case.

Thanks,

Atikant

@SnehasisP0085 We achieved this by hiding column header and data cells using javascript snippet. Check this article with steps and code.

https://nidri.medium.com/hide-column-conditionally-in-pega-table-d8da707a2658

@Nidri I tried using never in the java code but it still doesn’t work. Can you please attach the rules screenshots if possible?

PS - I am using Pega 8.3

@DhruvD24 Can you post your code snippet where you used when condition?