Show columns based on the Users Role

Here’s a video on how to set this up:


TB.render('component_ID', function(data) {
    if('{loggedInUser.Role}' === 'Management'){
    } else if ('{loggedInUser.Role}' === 'Packaging'){
    } else if ('{loggedInUser.Role}' === 'Shipping'){
    } else if ('{loggedInUser.Role}' === 'Retail'){

After recording the video above, I found a similar post. I’ll link it here for reference.


@Chem I tried to do this for 2 roles, I would like to give access, so I used the double pipe || for or. But I used the solution of Lee. Alas this only worked for the first role, but not for the second role. I am sure this has to do with my lack of understanding of NOT, AND and OR, but could you help here?

Why is this button only visible for “Directie” and not for “CRM-OM” role?

TB.render(‘component_3’, function(data) {

Hey @Peter,

I believe you want to do this.

 TB.render('component_ID', function(data) {
    if(!"{loggedInUser.Role}".contains('Directie') || !"{loggedInUser.Role}".contains('CRM-OM')){

@Chem The solution I was looking for is a bit different.
So the idea I followed was: hide the button for all roles.
Then show the button if the role is for “Directie” or for “CRM-OM”.
This is what came out:

TB.render('component_3', function(data) {

And this works as intended.

1 Like