Recent searches


No recent searches

Hiding forms based on end user's organzation in multi brand set up



Posted Mar 20, 2025

My company uses Zendesk for internal ticketing system. We have set up 2 brands and multiple forms for our internal users. Each brand has its own help center. Some forms are specific to one brand and some are used in both the brands. But we want certain forms to be hidden from certain end users based on their organization. I have used the following code to hide forms based on end user 's organization:

$(document).ready(function() {

var formID = 12345; // This is the form ID you wish to remove

var userOrgs = window.HelpCenter.user.organizations;

var userOrgNames = userOrgs.map(org => org.name);

if (!(userOrgNames.includes("xyz"))) { // Specify the organization name here

// If the user does not belong to the organization specified, remove the form option from the dropdown

$('#request_issue_type_select option[value="' + formID + '"]').remove();

$('.nesty-panel').on('DOMNodeInserted', function(e) {

$(this).children('ul').children().remove('#' + formID);

});

}

});

This code worked fine in 1 help center. But when I tried to use the same code in the second brand's help center, it isn't working. I made sure I included correct form ID's and organization names in the code. Nothing is different between 2 help centers, except the brand name and some UI elements. I am not sure why the code isn't working for multiple brands.

Any suggestions? Thanks in advance.


0

0

0 comments

Please sign in to leave a comment.

Didn't find what you're looking for?

New post