I have a custom card widget that’s been created as a shortcut to a Service Catalog item. This item however is only available to one requester group intentionally. While the item is restricted to all other requesters, the card widget is not. Rather, it will just redirect to an error page for anyone who is not in the designated requester group. Is there a way for me to hide this widget to only be viewable by this requester group to avoid others clicking on it and being concerned about the error page?
Hide Custom Card Widgets on Service Portal
Best answer by zachary.king
Hello
Something similar to this should work
<script>
$(document).ready(function () {
var userEmail = '{{user_info.email}}';
if (userEmail === 'zachary.king@ced.com') {
$('a.card[data-ce-id="id-of-your-card-here"]').hide();
}
});
</script> Hope that helps!
Thank you so much! I’m curious though if this script could be altered to check if the logged in user is within a certain requester group instead of checking the email? Im worried about upkeeping long term if the requester moves departments. It’d be easier to alter the requester group vs editing the script.
You might be able to call the Freshservice API to check if the logged in user is a part of the requester group. I would agree, the overall maintenance of managing the list of people could get tedious.
Join the Community
Sign in to the Community
Social Login
Login for Freshworks Employees Login with LinkedInEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.


