Can I hide the department field on the pre-chat form?

Return to top

8 Comments

  • Chinh Phan

    Hi,

    I read both these urls: 
    https://support.zendesk.com/hc/en-us/articles/115010352968
    https://support.zendesk.com/hc/en-us/articles/360022184994?page=1#comment_360004897033

    But it's still not work on my end.

    Code:
    var _urlConfig = {
    'en-us': {
    departments: {
    enabled: ['']
    },
    locale: 'en-us'
    },
    '__default': {
      departments: {
    enabled: ['']
    },
    locale: 'en-us'
    };

    I also try to update enabled: ['']  to  enabled: [] or remove enable field. But it's not work at all.

    0
  • Thomas Verschoren
    Community Moderator

    The way to accomplish this is to define one default department in both the selected and enabled field:

    <!-- Start of Zendesk Widget script coded with https://widget.guide -->
    <script type="text/javascript">
    window.zESettings = {
       "webWidget": {
          "chat": {
             "departments": {
                "select": "hr",
                "enabled": ["hr"]
             }
          }
       }}
    </script>
    <!-- End of Zendesk Widget script -->

     

     

    0
  • Chinh Phan

    I tried.

    The button is not say "Chat" any more. It says "Help"

    0
  • Thomas Verschoren
    Community Moderator

    Make sure that the department you mention in the settings has

    1. Actually exists and is named identically in your Chat settings
    2. Has agents are available and online

     

    0
  • Chinh Phan

    Awesome, It hided.

    Many thanks

    0
  • Davide Gerevini cc

    Hi there

    We have two separate widgets each managed by a specific department (lets say Sales and Support).

    Following the guidelines above I was able to hide the department field on the pre-chat form of both widgets and set departments selection 

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

    Problem is that now the widgets show the offline form (with its welcome message) only when all the agents are offline.

    For example If some of Sales agents are online and all Support agents are offline, both widgets show the pre-chat module and on the Support widget it sends an email once compiled instead of starting the chat (as expected but no explanation in the form). I would rather expect that the widget whose agents are offline would show the offline form.

    Moreover if I also add a script to load a custom badge image on one of the two widgets (the other one uses the image specified in the Chat setup)

    <script type="text/javascript">
    window.zESettings = {
    webWidget: {
    launcher: {
    badge: {
    layout: 'image_only'
    }
    }
    }
    };
    </script><script type="text/javascript">
    window.zESettings = {
    webWidget: {
    launcher: {
    badge: {
    image: 'support.jpg'
    }
    }
    }
    };
    </script>

    the previous setup seems to be ignored, and the drop down menu for choosing the department appears again.

    Any help will be appreciated, thank you!

    0
  • Adrian Joseph Magboo
    Zendesk Employee

    Hi Davide,

     

    Good day! It looks like you've assigned a department to each of your widgets and you would like to set the widget status depending on the status of the department assigned. 

    If this is the case, you can use the API script mentioned here Can I configure the Web Widget to present Chat on my webpage only when a specific department is online?

     

    I hope this helps. 

     

    Regards,

    Adrian

    0
  • Davide Gerevini cc

    Hey Adrian

    This worked beautifully, thank you! I totally missed that script.

    Thanks again,

    Davide

    0

Please sign in to leave a comment.

Powered by Zendesk