image for site

Hide Department Field on Zendesk Pre-Chat Form

Learn how to hide the department field on Zendesk's pre-chat form using a simple script. Make it invisible to visitors easily.

How can I hide the department field on the Zendesk pre-chat form?

To hide the department field on the Zendesk pre-chat form, you can use a specific script. While there's no native setting to completely remove the department field, you can make it invisible to visitors by using the Departments API endpoint with an empty array.

Here's the script you need to add after your widget script on your website:

<script type="text/javascript"> window.zESettings = { webWidget: { chat: { departments: { enabled: [] } } } }; </script>

This code will prevent visitors from seeing the department dropdown, but you can still assign a department to a chat request on the backend using a trigger or the departments.select function. For more details, check out the originalZendesk article.


More related questions

Can I make the department field optional on the Zendesk pre-chat form?

Yes, you can make the department field optional on the Zendesk pre-chat form. By default, the department field is not removable, but you can make it optional by unchecking the 'Require Department' option in your pre-chat form settings. This means…

What should I do if the department field still shows after using the script?

If the department field still appears after using the script to hide it, there might be a conflict with other code on your website. It's important to ensure that the script is correctly placed after your widget script. You can test your widget and…

Can I assign a department to a chat request without showing the field?

Yes, you can assign a department to a chat request without showing the department field to visitors. Even if the department field is hidden using the script, you can still manage department assignments on the backend. This can be done using a…

Why does the department field become hidden when only one department is available?

When there's only one department option available and it is already selected, the department field becomes hidden automatically. This is because visitors won't be able to interact with it, and the department is set by default. In such…

Interested indeflectingover 70% of your Zendesk support tickets?

Our AI customer support agent is here to help. Trained on all your help docs, installed directly into your Zendesk account, it can be used to automate customer replies for tickets or live chat. Learn more below.
Zendesk logo

Zendesk Support Tickets

Receive new tickets by email or a support form? This integration is for you.
My AskAI integrated within Zendesk to deflect support tickets
Learn about our Zendesk ticket integration
Zendesk logo

Zendesk Messaging (live chat)

Using Zendesk's Messaging widget on your site for live chat? This integration is for you.
My AskAI integrated within Zendesk to deflect customer support live chat conversations
Learn about our Zendesk Messaging integration

Join1,000+ companies reducing their support costs and freeing up support agents for more important work

Vestd company logo — Customer of My AskAI's AI customer support agents
Genesis company logo — Customer of My AskAI's AI customer support agents
Zinc company logo — Customer of My AskAI's AI customer support agents
Customer.io company logo — Customer of My AskAI's AI customer support agents
Zeffy company logo — Customer of My AskAI's AI customer support agents
NHS company logo — Customer of My AskAI's AI customer support agents
Kontakt.io company logo — Customer of My AskAI's AI customer support agents

Reduce support costs.Spend more time on customer success.

Our AI customer support agents are already used by 👇
Companies using AI assistants on their websites