Role and Current User condition

Hi,
how can I hide the Contract category for the Employee role where the value of the Email field does not match the value of the CurrentUser.Login field.
Thanks for help

Hello,
I would setup On model load script. Something like (depends, if email is string or url type):

    if (doo.currentUser.roles.includes('Employee')) {
        if (doo.model.email.value?.href !== doo.currentUser.login) {
            doo.model.hideCategory('XY');
        }
    }

    if (doo.currentUser.roles.includes('Employee')) {
        if (doo.model.email.value !== doo.currentUser.login) {
            doo.model.hideCategory('XY');
        }
    }

Regards

Michal

Hi Michal,
how to refer to the linked field in the condition?
In the scrip, there is a message “Property href does not exist on type IDooLinkToOneUser”, because the email in the Employee table is a link field to table User (field login).
Thanks
Jan

Hello,
Is the link shown in the table?
You need to use dot notation to access linked object properties. Or calculated field if you want to simplify it.
It would be easier to contact our support@tabidoo.cloud and go through your specific application.
Regards
Michal